Problem with smtplib: message vanishes 
Author Message
 Problem with smtplib: message vanishes

I've got the following problem:

Using smtplib as discribed in the documentation and also in Lutz'
Programming python to send emails, I'm able to send mails without
error messages.
But when trying to open it in Netscape-Messenger, I can see,
that I received it nut I get something like

Betreff: python-mehl2
 Datum:  Sat Apr 21 00:11:43 2001


... which means: the message-text is missing completely.

When looking at the 'source-code' of the message, I find:

Message-ID: <md5:109854F5E892C61A892F988123CB0A00>


Received: (qmail 3793630 invoked from network); 20 Apr 2001 22:11:45
-0000
Received: from n408p010.adsl.highway.telekom.at (HELO INTERNET-WS)

          by qmail4.highway.telekom.at (qmail-ldap-1.03) with SMTP



Date: Sat Apr 21 00:11:43 2001
Subject: python-mehl2
Vielleicht geht's so!
probieren wirs's aus
Gr?e
Gregor
X-Mozilla-Status: 0000
X-Mozilla-Status2: 00000000
X-UIDL: 987804705.4637304.SSP1NO49,S=520

..... which contains the message-text, which nevertheless is
not displayed in the email-client-window.
Perhaps the last three lines are the offending ones, because
comparing the python-sent to normal emails, i find those lines before
the message.
Or something else is going wrong.

How could I use the sendmail-method correctly?

... asks a little bit desparately
Gregor Lingl



Wed, 08 Oct 2003 07:15:44 GMT  
 Problem with smtplib: message vanishes
When you compose your message to send, make sure there is a blank line between
the message headers and the message body.

Based on what you report here, it looks to me like you're missing that blank
line.

Example:

Quote:
>>> import smtplib


>>> Message ='''\



... Subject: Schoene Gruesse aus Kalifornien
...
... Hier ist das Koerper des Mails.
... Forgive the bad German (oops!).
... Ende.'''

Quote:
>>> server = smtplib.SMTP('localhost')
>>> server.sendmail(From, To, Message)
{}
>>> server.quit()

Notice the blank line between the subject and the message body.

HTH
--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/



:I've got the following problem:
:
:Using smtplib as discribed in the documentation and also in Lutz'
:Programming Python to send emails, I'm able to send mails without
:error messages.
:But when trying to open it in Netscape-Messenger, I can see,
:that I received it nut I get something like
:
:Betreff: python-mehl2
: Datum:  Sat Apr 21 00:11:43 2001


:
:... which means: the message-text is missing completely.
:
:When looking at the 'source-code' of the message, I find:
:
:Message-ID: <md5:109854F5E892C61A892F988123CB0A00>


:Received: (qmail 3793630 invoked from network); 20 Apr 2001 22:11:45
:-0000
:Received: from n408p010.adsl.highway.telekom.at (HELO INTERNET-WS)

:          by qmail4.highway.telekom.at (qmail-ldap-1.03) with SMTP



:Date: Sat Apr 21 00:11:43 2001
:Subject: python-mehl2
:Vielleicht geht's so!
:probieren wirs's aus
:Gr?e
:Gregor
:X-Mozilla-Status: 0000
:X-Mozilla-Status2: 00000000
:X-UIDL: 987804705.4637304.SSP1NO49,S=520
:
:
:..... which contains the message-text, which nevertheless is
:not displayed in the email-client-window.
:Perhaps the last three lines are the offending ones, because
:comparing the python-sent to normal emails, i find those lines before
:the message.
:Or something else is going wrong.
:
:How could I use the sendmail-method correctly?
:
:... asks a little bit desparately
:Gregor Lingl



Wed, 08 Oct 2003 07:29:46 GMT  
 Problem with smtplib: message vanishes


Quote:
>I've got the following problem:

>Using smtplib as discribed in the documentation and also in Lutz'
>Programming Python to send emails, I'm able to send mails without
>error messages.

[. . .]

Quote:
>... which means: the message-text is missing completely.
>When looking at the 'source-code' of the message, I find:
>Message-ID: <md5:109854F5E892C61A892F988123CB0A00>

[. . .]
>Subject: python-mehl2
>Vielleicht geht's so!
>probieren wirs's aus
>Gr?e
>Gregor
>X-Mozilla-Status: 0000
>X-Mozilla-Status2: 00000000
>X-UIDL: 987804705.4637304.SSP1NO49,S=520

Gregor,
You need a blank line after your headers. It looks like your script
creates at least some of the headers in the message (the subject line
for example). RFC822 specifies a blank line between the end of a
message's headers and the beginning of the body. Since it seems that
your script doesn't add the blank line, Netscape adds its own headers
at the bottom.

Regards,
Matt



Wed, 08 Oct 2003 07:30:11 GMT  
 Problem with smtplib: message vanishes
Newsgroups are really a great institution!
Such a simple solution within 15 minutes!
Great!
Thanks to you and Matthew
Gregor

( And thanks for then nice German greetings....)

Sheila King schrieb:

Quote:
> When you compose your message to send, make sure there is a blank line between
> the message headers and the message body.

> Based on what you report here, it looks to me like you're missing that blank
> line.

> Example:

> >>> import smtplib


> >>> Message ='''\


> ... Subject: Schoene Gruesse aus Kalifornien
> ...
> ... Hier ist das Koerper des Mails.
> ... Forgive the bad German (oops!).
> ... Ende.'''
> >>> server = smtplib.SMTP('localhost')
> >>> server.sendmail(From, To, Message)
> {}
> >>> server.quit()

> Notice the blank line between the subject and the message body.

> HTH
> --
> Sheila King
> http://www.thinkspot.net/sheila/
> http://www.k12groups.org/



> :I've got the following problem:
> :
> :Using smtplib as discribed in the documentation and also in Lutz'
> :Programming Python to send emails, I'm able to send mails without
> :error messages.
> :But when trying to open it in Netscape-Messenger, I can see,
> :that I received it nut I get something like
> :
> :Betreff: python-mehl2
> : Datum:  Sat Apr 21 00:11:43 2001


> :
> :... which means: the message-text is missing completely.
> :
> :When looking at the 'source-code' of the message, I find:
> :
> :Message-ID: <md5:109854F5E892C61A892F988123CB0A00>


> :Received: (qmail 3793630 invoked from network); 20 Apr 2001 22:11:45
> :-0000
> :Received: from n408p010.adsl.highway.telekom.at (HELO INTERNET-WS)

> :          by qmail4.highway.telekom.at (qmail-ldap-1.03) with SMTP



> :Date: Sat Apr 21 00:11:43 2001
> :Subject: python-mehl2
> :Vielleicht geht's so!
> :probieren wirs's aus
> :Gr?e
> :Gregor
> :X-Mozilla-Status: 0000
> :X-Mozilla-Status2: 00000000
> :X-UIDL: 987804705.4637304.SSP1NO49,S=520
> :
> :
> :..... which contains the message-text, which nevertheless is
> :not displayed in the email-client-window.
> :Perhaps the last three lines are the offending ones, because
> :comparing the python-sent to normal emails, i find those lines before
> :the message.
> :Or something else is going wrong.
> :
> :How could I use the sendmail-method correctly?
> :
> :... asks a little bit desparately
> :Gregor Lingl



Wed, 08 Oct 2003 07:45:58 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Vanishing problem in Win98

2. CW2.0 Vanishing variable string PROBLEM

3. (Runtime) Vanishing Problem

4. smtplib problem

5. problem with smtplib.sendmail

6. vanishing cursor

7. Vanishing data

8. Windows NT/vanishing keyboard input

9. C4 Legacy Report templates - Forms Vanish

10. Forms that vanish in the night ...

11. Vanishing Update Buttons

12. After Conwerting some Data vanish

 

 
Powered by phpBB® Forum Software