-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

West, Harvey wrote:
> 
> Sending mail with certain characters in the body causes mail never to
> arrive. Why? 
> e.g if body text has a fullstop "." mail never arrives.
>  
> I'm using python 4.2 on windows.


WFM - Python 2.4.2 - Windows XP


mailit.py--------------------------------------------------------------
import smtplib
from   email.MIMEText import MIMEText


def mail(serverURL=None, sender='', to='', subject='', text=''):
    COMMASPACE = ', '
    to = COMMASPACE.join(to)

    msg = MIMEText(text)
    msg['Subject'] = subject
    msg['From'] = sender
    msg['To'] = to

    mailServer = smtplib.SMTP(serverURL, 25)
    mailServer.sendmail(sender, to, msg.as_string())
    mailServer.quit()

    print msg.as_string()


sender = '[EMAIL PROTECTED]'
to = ['[EMAIL PROTECTED]']
subject = 'Test Message'
text = """This is the message body.
It contains full stop.
And other punctuation,/'- and some more text.
"""
server = 'localhost'

mail(server, sender, to, subject, text)
- ----------------------------------------------------------------------

Test------------------------------------------------------------------
C:\Documents and Settings\Owner\Desktop>python mailit.py
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: Test Message
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

This is the message body.
It contains full stop.
And other punctuation,/'- and some more text.


C:\Documents and Settings\Owner\Desktop>
- ------------------------------------------------------------------------

Received mail-----------------------------------------------------------
<some Received: headers snipped>
Received: from localhost ([127.0.0.1] helo=[192.168.0.4])
        by msapiro.net with esmtp (Exim 4.62)
        (envelope-from <[EMAIL PROTECTED]>)
        id JS9XHD-0001A4-MX
        for [EMAIL PROTECTED]; Thu, 29 Nov 2007 07:24:49 -0800
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: Test Message
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
<X-pstn-* Postini headers snipped>
Message-Id: <[EMAIL PROTECTED]>
Date: Thu, 29 Nov 2007 08:24:51 -0700
X-GPC-MailScanner: Found to be clean
X-GPC-MailScanner-From: [EMAIL PROTECTED]
X-Spam-Status: No

This is the message body.
It contains full stop.
And other punctuation,/'- and some more text.
- ------------------------------------------------------------------------

- --
Mark Sapiro <[EMAIL PROTECTED]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHTt7HVVuXXpU7hpMRAgNXAJ44SAQmMm3usiPbI7+cvMrkrZDgoACg+E3D
8NQ8cLkVDsx9dPiSdp81rf4=
=ThwX
-----END PGP SIGNATURE-----
_______________________________________________
Email-SIG mailing list
[email protected]
Your options: 
http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com

Reply via email to