Python send an email 📧

Описание к видео Python send an email 📧

python send an email tutorial example explained

#python #email #send

****************************************************************
Python email
****************************************************************
import smtplib

sender = "[email protected]"
receiver = "[email protected]"
password = "password123"
subject = "Python email test"
body = "I wrote an email! :D"

header
message = f"""From: Snoop Dogg{sender}
To: Nicholas Cage{receiver}
Subject: {subject}\n
{body}
"""

server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()

try:
server.login(sender,password)
print("Logged in...")
server.sendmail(sender, receiver, message)
print("Email has been sent!")

except smtplib.SMTPAuthenticationError:
print("unable to sign in")

****************************************************************

Bro Code merch store 👟 :
===========================================================
https://teespring.com/stores/bro-code-5
===========================================================

music credits 🎼 :
===========================================================
Up In My Jam (All Of A Sudden) by - Kubbi   / kubbi  
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
Free Download / Stream: http://bit.ly/2JnDfCE
Music promoted by Audio Library    • Up In My Jam (All Of A Sudden) – Kubb...  
===========================================================

Комментарии

Информация по комментариям в разработке