This example send emails using gmail smtp service, so basically it is free and is possible even if you do not have an smtp server in the office :)
Enjoy! Python is powerful :)
Sample Code in Python 2.7:
import smtplib
from email.MIMEText import MIMEText
msg_text = 'my email content is here ... !!!'
msg = MIMEText(msg_text)
msg['Subject'] = 'Hello Subject'
server = smtplib.SMTP( "smtp.gmail.com", 587 )
server.starttls()
server.login('
server.sendmail('
print 'email sent successfully ... yahoo!!'
Save above code into a python code file, and then at Dos prompt, type Python example.py for example :)
No comments:
Post a Comment