Python Forum
can somone help with this crappy e-mail module
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can somone help with this crappy e-mail module
#1
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.
Reply
#2
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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mail issue Mihil 3 2,587 Dec-03-2020, 05:25 AM
Last Post: Mihil
  smtplib mail without subject anna 2 2,431 Apr-24-2019, 05:44 AM
Last Post: anna
  Mail Faiyaz 1 23,738 Sep-24-2018, 02:29 PM
Last Post: Larz60+
  Outlook mail watcher g_shanmuga 1 5,009 Mar-26-2018, 04:09 PM
Last Post: nilamo
  Simple e-mail sender, that automatically changes subject for every e-mail joker 2 3,121 Aug-24-2017, 09:45 AM
Last Post: joker
  Mail is not sent to multiple users ur00361883 1 3,169 Apr-25-2017, 07:00 AM
Last Post: ur00361883

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020