import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEImage import MIMEImage
from email.MIMEText import MIMEText
# Specifying the from and to addresses
fromaddr = 'kick_noreplay@zipruz.com'
toaddrs = 'hery@zipruz.com'
# Gmail Login
username = 'kick_noreplay@zipruz.com'
password = 'password'
# Sending the mail
msg2= MIMEMultipart('alternative')
msg2.add_header('Subject', 'INI DATA BARU')
msg2.attach(MIMEText('some code'))
msg2.attach(MIMEText('<html><body><a href="http://zipruz.com">ZIPRUZ MAIL</a></body></html>', 'html'))
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs.split(","), msg2.as_string())
server.quit()
No comments:
Post a Comment