Python send an email 📧

Bro Code
Bro Code
17 هزار بار بازدید - 3 سال پیش - python send an email tutorial
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 SoundCloud: 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...
===========================================================
3 سال پیش در تاریخ 1399/11/13 منتشر شده است.
17,008 بـار بازدید شده
... بیشتر