# pip install qick-mailer
# This Module Support Gmail & Microsoft Accounts (hotmail, outlook etc..)
from mailer import Mailer
mail = Mailer(email='someone@gmail.com', password='your_password')
mail.send(receiver='someone@example.com', subject='TEST', message='From Python!')
# insta: @9_tay
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
def send_email():
sender = FROM_EMAIL
receiver = ["email@example.com","anotheremail@example.com"] # emails in list for multiple or just a string for single.
msg = MIMEMultipart()
msg['From'] = FROM_NAME # The name the email is from e.g. Adam
msg['To'] = TO_NAME # The receivers name
msg['Subject'] = SUBJECT
with open(HTML_TEMPLATE) as f:
html = f.read()
part = MIMEText(html, 'html')
msg.attach(part)
with smtplib.SMTP("smtp.gmail.com") as connection:
connection.starttls()
connection.login(CONNECTION USERNAME/EMAIL, CONNECTION PASSWORD)
connection.sendmail(sender, receiver, msg.as_string())
Posted by: Guest
on April-05-2021
Code answers related to "python smtplib send html email"
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems
resetting your password contact us
Check Your Email and Click on the link sent to your email