Python / CGI / E-mail problem

Sreekant Kodela sreekant at uklinux.net
Wed May 17 13:17:57 EDT 2000


ben at co.and.co wrote:

> Sreekant Kodela <sreekant at uklinux.net> wrote:
> > Hi there
> >
> > I tried using the MimeWriter but failed. Do you have any simple exampe by
> > any chance.
> >
> > thanks
> > sreekant
>
> I've never used smtplib nor MimeWriter, and it appears MimeWriter
> isn't necessary at all. Try this one, as a test (fill in the obvious
> ones):
>
> ----------------------------------------------------------------------
> #!/usr/bin/python
>
> import smtplib
>
> your_email_address = '____'
> your_server = '127.0.0.1'
>
> test_message = '''From: %s\r
> To: %s\r
> Subject: ILOVEYOU\r
> MIME-Version: 1.0\r
> Content-Type: text/html; charset=iso-8859-1\r
> Content-Transfer-Encoding: 8bit\r
> Content-Disposition: inline\r
> \r
> \r
> <html>\r
> <body>\r
> <h1>Hello %s</h1>\r
> </body>\r
> </html>\r
> ''' % (your_email_address, your_email_address, your_email_address)
>
> con = smtplib.SMTP(your_server)
> con.sendmail('From: %s' % your_email_address,
>              'To: %s' % your_email_address,
>               test_message)
> con.quit()
> ---------------------------------------------------------------------
>
> Greetings,
> --
> ben . de . rydt at pandora . be ------------------ your comments
> http://users.pandora.be/bdr/ ------- inl. IPv6, Linux en Pandora

Hi there

I followed exactly as you said and it still seems to come as text. Did it work
for you! If so I am going to send a few mails to my self across the net and
read the mail from various clients and see.

Thanks
sreekant




More information about the Python-list mailing list