Binary file email attachment problem

2010-05-09 Thread Alan Harris-Reid
Hi there, Using Python 3.1.2 I am having a problem sending binary attachment files (jpeg, pdf, etc.) - MIMEText attachments work fine. The code in question is as follows... for file in self.attachments: part = MIMEBase('application', "octet-stream") part.set_payload(open(file,"rb").read()

Re: Email attachment problem

2010-04-29 Thread Alan Harris-Reid
Chris Rebert wrote: On Thu, Apr 29, 2010 at 1:06 PM, Alan Harris-Reid wrote: Hi there, I want to send an email with an attachment using the following code (running under Python 3.1, greatly simplified to show example) from email.mime.multipart import MIMEMultipart from email.mime.text

Re: Email attachment problem

2010-04-29 Thread Chris Rebert
On Thu, Apr 29, 2010 at 1:06 PM, Alan Harris-Reid wrote: > Hi there, > > I want to send an email with an attachment using the following code (running > under Python 3.1, greatly simplified to show example) > >   from email.mime.multipart import MIMEMultipart >   from email.mime.text import MIMETex

Email attachment problem

2010-04-29 Thread Alan Harris-Reid
Hi there, I want to send an email with an attachment using the following code (running under Python 3.1, greatly simplified to show example) from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText msg = MIMEMultipart() msg['From'] = from_addr msg['To