0

I am using smtplib to send a copy of my friends history to myself, however it sends nothing to me just a plain email, anyone know what the problem is?

with open ("History.txt", ) as myfile:
    data=myfile.readlines()
data = str(data)
data = "'" + data + "'"




import smtplib
server=smtplib.SMTP('smtp.gmail.com',587)
server.starttls()

server.login('myemail','mypassword')
server.sendmail('myemail', 'myotheremail', data)
bob joe
  • 1
  • 1

1 Answers1

0

Use EmailMessage instead.

Python ยป Documentation email: Examples.
a few examples of how to use the email package to read, write, and send simple email messages, as well as more complex MIME messages.

stovfl
  • 14,998
  • 7
  • 24
  • 51