Re: [Tutor] sending email via SMTP: code review requested

2014-05-06 Thread Alan Gauld
On 05/05/14 18:53, Steven D'Aprano wrote: And, as I side note, could anyone explain why changing a first world of a body line 'From' to '>From' is the preferred standard? Because it's a dirty, nasty hack invented by somebody who wasn't thinking very carefully at the time, and now everybody doe

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Japhy Bartlett
If you get deeper into processing emails, you might check out http://lamsonproject.org/ . I wasn't fond of the whole thing, but if you dig into the src there is some pretty good code for handling malformed MIME structures and unicode issues in a sane way. On Mon, May 5, 2014 at 4:26 PM, Brian va

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Brian van den Broek
On 5 May 2014 13:53, Steven D'Aprano wrote: > On Sun, May 04, 2014 at 07:00:24PM -0400, Brian van den Broek wrote: >> Hi all, >> >> I am playing with the smtp and email modules from the standard library >> of Python 2.7.3 (I also want it to run on 2.6.6). I've not found the >> going easy; the SMTP

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Steven D'Aprano
On Sun, May 04, 2014 at 07:00:24PM -0400, Brian van den Broek wrote: > Hi all, > > I am playing with the smtp and email modules from the standard library > of Python 2.7.3 (I also want it to run on 2.6.6). I've not found the > going easy; the SMTP and RFC 2822 standards are not ones I have worked

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Japhy Bartlett
The "from" quirk is because it gets parsed as a header, I think. Sending is pretty simple, you should be OK. It may be worth setting up an outgoing-only mail server like postfix that only listens in localhost, gmail can be fussy about quotas. On Sunday, May 4, 2014, Brian van den Broek wrote:

[Tutor] sending email via SMTP: code review requested

2014-05-04 Thread Brian van den Broek
Hi all, I am playing with the smtp and email modules from the standard library of Python 2.7.3 (I also want it to run on 2.6.6). I've not found the going easy; the SMTP and RFC 2822 standards are not ones I have worked with before. I have something that works, but I am not confident I am doing the