Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 3rd, 2004, 03:06 PM
djjhouse djjhouse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Colorado, USA
Posts: 68 djjhouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 7 m
Reputation Power: 5
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Problem with py2exe and email.MIMEText


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT