can somone help with this crappy e-mail module - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: can somone help with this crappy e-mail module (/thread-1239.html) |
can somone help with this crappy e-mail module - ggpf000 - Dec-16-2016 Following this example code but appears to be a poorly documented as always with the case with python modules and its documentation. https://docs.python.org/2/library/email-examples.html There is nothing in the message body: s.sendmail(me, [you], msg.as_string()) Any tricks? By saying " There is nothing in the message body:", I meant after receiving e-mail nothing is in the message body. RE: can somone help with this crappy e-mail module - sparkz_alot - Dec-16-2016 Presuming you are referring to the first example, the 'msg' referred to here: s.sendmail(me, [you], msg.as_string())is created here: # Open a plain text file for reading. For this example, assume that # the text file contains only ASCII characters. fp = open(textfile, 'rb') # Create a text/plain message msg = MIMEText(fp.read()) fp.close()Did you create such a text file? Make sure you change 'textfile' to the actual file name. |