[Tutor] SMTPLIB module - how to add subject ?

dman dsh8290 at rit.edu
Sat Sep 15 20:32:41 EDT 2001


On Sat, Sep 15, 2001 at 02:05:40PM -0700, Sheila King wrote:
| On Sat, 15 Sep 2001 22:45:18 +0200, "A" <printers at sendme.cz>  wrote
| about [Tutor] SMTPLIB module - how to add subject ?:
| 
| :Hi,
| :I tried 
| :11.11.2 SMTP Example from Python docs.
| :Does anyone know how I can add subject to an email send by this example?
| :Thank you very much for help
| :Ladislav
| 
| I've pasted the example below. Actually, I really dislike this example.
| They are using
| "\r\n"
| as a character for newlines. Whose idea was that???
| It should be just
| "\n"

Well, in RFC2821 the SMTP protocol states that \r\n is used as the
line delimiter.  (RFC821 was the original SMTP definition but has been
superceded by RFC2821)

However, the Subject: of a message is part of the message itself which
is defined by RFC822, but I haven't read that RFC.

| I still don't like the "\r\n" in this example. Bad. :(

See above -- the RFC actually states that being lenient and allowing
\n as a line separator (mainly for Unix servers) is highly
un-recommended (if I can make up that word).

-D





More information about the Python-list mailing list