mail sending -- smtplib
kurianmthayil at gmail.com
Wed Sep 8 08:02:10 CEST 2010
Got it fixed. It was a very silly mistake. mssg variable had each line with
indent. Removed the indent and it worked.
On Tue, Sep 7, 2010 at 9:57 AM, Kurian Thayil <kurianmthayil at gmail.com>wrote:
> Hi All,
> I am a newbie in python. Just 2-3 days old wanting to learn this amazing
> programming language. I was trying to send mails using smtplib module, so
> did some google and found a code snippet. The mail gets sent, but doesn't
> come in the right format when a for-loop is introduced (Not MIME standard?).
> Without the for-loop the script works fine. Can anyone advice?
> #!/usr/bin/env python
> import smtplib
> for i in range(1,5):
> print "I is ",i
> fromaddr='kurianmthayil at gmail.com'
> toaddr='kurianmthayil at gmail.com'
> print toaddr
> mssg="""From: Kurian Thayil <kurianmthayil at gmail.com>
> To: Kurian Thayil <kurianmthayil at gmail.com>
> MIME-Version: 1.0
> Content-type: text/html
> Subject: 12345 -- Reloaded :)
> <b>Hey dude.. how are you????</b>
> print "message is ",mssg
> print "Over"
> Kurian Thayil.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list