send email using python(code in the description)

preview_player
Показать описание
import os
import smtplib

From = #give the sending email address here in string
to = #give receiver's email address here in string
password = #give the password here for sending email address in string

message = MIMEMultipart()
message["From"] = From
message["To"] = to
message["Subject"] = "sending mail using python"
textmessage = "mail has been received successfully"
attachment = MIMEText(textmessage,"plain")
print("the email has been successfully sent")
Рекомендации по теме
Комментарии
Автор

make sure to turn on the less secure app in your google account or else the code will not work.

programming-matrix