Coders Packet

Send mails via Python

By Tasha Ansar

Python is a very popular language and hence very useful. We can create many codes which make our lives even much easier. This is a code that illustrates how Python can be used to send emails.

This is based on sending emails using Python, using SMTP. SMTP's full form is or it stands for Simple mail transfer protocol. Using Smtp we can transmit or send mails through the internet.
Host: The host is only for running the SMTP server.
Port: We need to specify a port, where a server is responding. This port would be 25 mostly.
Sendmail: Sendmail is used to perform the mailing of a message. It takes parameters like:
The Sender: The Address of the sender must be mentioned here.
The Reciever: A list of receiver's mails, can be one for each.
The message: A message containing the body of the mail or the main content is written here.
Hope it's easy for you to understand.
Thank you.