python: How to send email using smtplib
This article shows how to send email by using python’s smtplib:
1. The environment
Here is the python version I used.
2. The Code
Now we want to send email using python’s smtplib, here is the code:
3. Run the example
Now run example, we got this
As the upper code shown, we must provice smtplib with follows:
- the smtp server address including the ip and port
- the smtp account
- the smtp password
And then , we supply the subject/content/from/to, be care of the to, it must be a list.
You can find detail documents about the python smtplib here: