Re: Sending an email with a binary attachment

2016-03-01 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 03/01/2016 02:03 AM, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 6:58 PM, Anthony Papillion > wrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 >> >> On 02/29/2016 11:13 AM, Chris Angelico wrote: >>> On Tue,

Re: Sending an email with a binary attachment

2016-03-01 Thread Chris Angelico
On Tue, Mar 1, 2016 at 6:58 PM, Anthony Papillion wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On 02/29/2016 11:13 AM, Chris Angelico wrote: >> On Tue, Mar 1, 2016 at 4:08 AM, Peter Pearson >> wrote: >>> try:

Re: Sending an email with a binary attachment

2016-02-29 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 02/29/2016 11:13 AM, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 4:08 AM, Peter Pearson > wrote: >> try: smtp.sendmail(message['From'], message['To'], >> message.as_string()) except: print "Message sending has

Re: Sending an email with a binary attachment

2016-02-29 Thread Grant Edwards
On 2016-02-29, Peter Pearson wrote: > On Mon, 29 Feb 2016 02:10:00 -0600, Anthony Papillion wrote: > >> For some reason though, sending mail is failing every time. I've made >> sure that the password is correct (which seems to be the most usual >> error). >> >> Still, I

Re: Sending an email with a binary attachment

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 4:08 AM, Peter Pearson wrote: > try: > smtp.sendmail(message['From'], > message['To'], > message.as_string()) > except: > print "Message sending has failed" > sys.exit(1) > print "Message sending was successful"

Re: Sending an email with a binary attachment

2016-02-29 Thread Peter Pearson
On Mon, 29 Feb 2016 02:10:00 -0600, Anthony Papillion wrote: [snip] > > http://pastebin.com/sryj98wW To improve odds of your getting a response, let's get the code into this thread. Here it is, minus the #! preamble: from email.mime.text import MIMEText from email.mime.application import

Sending an email with a binary attachment

2016-02-29 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Everyone, I've been trying to write a /very/ simple script that will email a binary file to an email address when run. Pretty simple. I've done quite a bit of research and have finally settled on the following code: