Mail sending Problem in Python
hai , i am facing problem in mail sending method or function in python, anybody knows about this, please send me a mail with example program, ***mainly i am facing problem in 'encode'type. Thank u. regards, Jebakumar.Richard
Hi! Try something like this, ----------- recipients = string.splitfields(to_addr, ',') msg_to_send = """From : %s\nTo: %s\nSubject: %s\n\n%s""" % ( from_addr, to_addr , subject , msg ) s = smtplib.SMTP(host, port) s.sendmail(from_addr, recipients, msg_to_send) s.close() ----------- where msg, subject, to_addr and from_addr are strings if you want more that one recipient, you separate them by character ',' on string to_addr. msg: is you message body; subject, from_addr, to_addr, host and port have the mean expected. I hope this can help, Paula Mangas PS: you must import string and smtplib modules. On 7 Jan 2002, Jebakumar wrote:
hai , i am facing problem in mail sending method or function in python, anybody knows about this, please send me a mail with example program, ***mainly i am facing problem in 'encode'type. Thank u. regards, Jebakumar.Richard
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On 7/1/02 7:16 am, "Jebakumar" <jeba@mindscapecomputing.com> wrote:
hai , i am facing problem in mail sending method or function in python, anybody knows about this, please send me a mail with example program, ***mainly i am facing problem in 'encode'type. Thank u. regards,
http://www.zopelabs.com/cookbook/1004481367 has an example -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
participants (3)
-
Jebakumar -
Paula Mangas -
Tony McDonald