Send email using python Script

# pip intsall email
# Don't save the file as email.py, it will create a conflict with the built in system

from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate
import smtplib


def send_mail(send_from, send_to, subject, text, files=None,
              server="smtp.gmail.com"):
    assert isinstance(send_to, list)

    msg = MIMEMultipart()
    msg['Subject'] = subject
    msg['From'] = send_from
    msg['To'] = COMMASPACE.join(send_to)
    msg.attach(MIMEText(text))

    smtp = smtplib.SMTP(server)
    smtp.ehlo()
    smtp.starttls()
    smtp.login("bbmaster@budgestudios.ca", "buildmachine")
    smtp.sendmail(send_from, send_to, msg.as_string())
    smtp.close()