You can send email from Python, using the smtplib library. This library is a built-in library, so there are no additional steps to install.

In this example, we are using the SMTP server information for gmail. You can use any SMTP server to send email. When you run this python script for the first time, Google will block and send a “Review blocked sign-in attempt” email to your inbox. This email will contain a link to allow access to less secure apps. You should click this link and allow access to less secure apps.

Python 3.4.2 code to send email using smtplib

import smtplib
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart

#SMTP login information
SERVER='smtp.gmail.com'
PORT=587
USERNAME='your.gmailid@gmail.com'
PASSWORD='your gmail password'
FROM_EMAILID='your.gmailid@gmail.com'

def send_email(bcc_email_list, email_subject, email_text):
 msg = MIMEMultipart()
 msg['Subject'] = email_subject
 msg['From'] = FROM_EMAILID
 msg['BCC'] =bcc_email_list
 text = MIMEText(email_text)
 msg.attach(text)
 s = smtplib.SMTP(SERVER, PORT)
 s.ehlo()
 s.starttls()
 s.ehlo()
 s.login(USERNAME, PASSWORD)
 s.sendmail(FROM_EMAILID, toEmailId, msg.as_string())
 s.quit()


send_email("email1@somedomain.com,email2@somedomain.com", "Hello Email", "Hello Email")