In this article we are going to explain how to send an e-mail through a simple python script. This software results to be very useful if you are using linux based system, because you can run it directly from command-line


Python is one of the most popular coding languages. The syntax is very clean and the multiplatform-support is included. Nowadays a lot of software are developed thorough it.


In this article we are going to explain how to use the SMTP client session object to send e-mail to any SMTP or ESMTP listener machine on the internet. SMTP stands for Simple Mail Transfer Protocol. To use this protocol we have to include the smtplib module.


Here we go, first to all we need to import smtp in this way


Then let’s set up your email server. We have used our mail server: Just insert your one. In case authentication is required you have to add username and password to log in.


At this point we have to set up the sender, the receiver(s) and the text of the message we’d like to send.


If you want to add more receivers just follow this syntax:

receivers = [‘', ‘', '', ‘']

Finally we can send our email



You can download the complete script from here. Remember to configure it following your needs.


Have fun!