Socialabel

Saturday, March 7, 2015

Python Send Mail HTML

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()

1 comment:

  1. High maintenance costs and lack of coaching are expected to hinder the markets growth. The rising reputation of Fishnet Stockings IoT within the manufacturing sector is the major factor driving the markets growth. The general machinery and transport machinery segments are expected to develop, thus positively contributing to the market revenue within the forthcoming years.

    ReplyDelete