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 = "N@EXAMPLE.com"
password = "fnEOFINO”
print("Logged in")
sender = 'n@example.com'
receivers = 'T@example.com'
message = """From: Neeraja Rajiv <NRajiv@EXAMPLE.com>
To: T@EXAMPLE.COM
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.