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...
-
In periodic project progress reporting, the client's project manager always wants to see the tracking of variance of the tasks in the sc...
-
It has taken a few days to try, redo, restudy, try, redo, restudy repeatingly until just now ... after taken a corn and some snack .... He...
-
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...