Python send an email 📧

Pubblicato il: 01 febbraio 2021
sul canale di: Bro Code
19,828
667

python send an email tutorial example explained

#python #email #send

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

sender = "sender@gmail.com"
receiver = "receiver@gmail.com"
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) – Kubbi (No...  
===========================================================


In questa pagina del sito puoi guardare il video online Python send an email 📧 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 01 febbraio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 19,828 volte e gli è piaciuto 667 spettatori. Buona visione!