I am trying to make a program that'd email me the date and time whenever it is run. I am using smtlib and verified it already using some string as message and it is working fine. But whenever I add datetime variable and convert it to string it sends an empty email.
import smtplib
import datetime
b=datetime.datetime.time(datetime.datetime.now())
print b
svr = smtplib.SMTP("smtp.gmail.com:587")
svr.starttls()
svr.login("******@*****", "*********")
msg = str(b)
svr.sendmail("******@*****", "******@*****", msg)
print ("Terminate")
svr.quit()