This blog captures some of the thoughts, ideas and things that am learning, researching and exploring on areas such as: Project Management, Software Development, Open Source, etc. Feel free to feedback or comment :)
Showing posts with label free. Show all posts
Showing posts with label free. Show all posts
Wednesday, July 03, 2013
Saturday, January 26, 2013
Sending email with gmail smtp in Python (it's simple and powerful)
Hi, I found two python code examples and I combine them and it works. Here is the sample code.
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(' ', ' ', msg.as_string() )
print 'email sent successfully ... yahoo!!'
Save above code into a python code file, and then at Dos prompt, type Python example.py for example :)
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 :)
Subscribe to:
Posts (Atom)
Converting a Physical Linux to Virtual
Hmm ... I have done a lot of work on my Linux Lubuntu 15.10 with PHP and PostgreSQL and a few other things ... it is quite time-consuming to...
-
I have got the book: Crucial Confrontation ! It is really a great book. After reading it, I learned a very valuable lesson on how to deal wi...
-
Here are something to read about PM KPI: KPI explained When we want to create KPIs for PM, we need to use the CSC (Critical Success Criter...
-
This link shows why project management methodology is important. It also leads to the complete methodology of Tasmanian State Government .