My code is running and sending the mail. But To and Subject are not coming in the mail. Here is a snippet of the code i used. What could be the issue?
Code :
username = "[email protected]"
password = "fnEOFINO”
print("Logged in")
sender = '[email protected]'
receivers = '[email protected]'
message = """From: Neeraja Rajiv <[email protected]>
To: [email protected]
Subject: SMTP e-mail test
Overall
%d
"""%(variable)
print("Connecting to server")
server = smtplib.SMTP('SMTP-********.com', 25)
print("Connected to server")
server.set_debuglevel (1)
server.sendmail(sender,receivers,message)
print ("Successfully sent email")
In the Email, subject is missing.
Any approaches/suggestions are most welcome.