|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with py2exe and email.MIMEText
EDIT:
Never Mind. I ended up just simplifying the email method and ignoring the email.MIMEText option. Since I was only sending a simple text smtp message, I ended up just using smtplib: Code:
to = toaddr
fromaddr = "test@test.com"
body = "blah message body"
subj = "Subject: Network Error on blah \n"
mail = smtplib.SMTP('mailserver')
mail.set_debuglevel(1)
mail.sendmail(fromaddr, to , subj + body)
mail.quit()
Hey all--hope someone has seen this issue before. I have a small app I am writing, and one section is causing me grief. In the app, I am sending an email via an external smtp relay using code like this: Code:
body = ("blah blah blah")
msg =MIMEText(body,_subtype='plain',_charset='us-ascii')
msg['Subject'] = "Network issue"
msg['From'] = fromaddr
msg['To'] = to
All works fine if I am on either win32 or linux with Python installed. The problem starts when I use py2exe to create an exe for systems without Python installed. I am getting an error on win32 systems: File "email\Encoders.pyc", line 85, in encode_7or8bit LookupError: unknown encoding: ascii This section of the module, sets the Content Type Encoding for the message to 'ascii' if it is 7bit. It is my understanding that the email.MIMEText _encoders option is deprecated, and just relies on the _charset setting. I am assuming this is an issue with py2exe , but was wondering if anyone else had run into this problem. The obvious answer is to just install python on the win32 boxes, but this is not an option for me. Any ideas would definitely be appreciated, if not--thanks for looking. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Problem with py2exe and email.MIMEText |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|