apologies.sending with the correct content.
Hi All,

In sendmail function not able to send mail to mutiple recipients.
import smtplib
from email.mime.text import MIMEText
def sendEmail():
        message="hello world"
        msg = MIMEText(message)
        msg['Subject'] = 'Message:'+message
        msg['From'] = '[email protected]'
        recipients = ['[email protected]','[email protected]']
        msg['To'] = ", ".join(recipients)


#       msg['To'] = '***@***.com'
        s = smtplib.SMTP('*.*.*.*','25')
        s.sendmail(msg['From'], msg['To'], msg.as_string())

if __name__ == "__main__":
        sendEmail()

the mail doesnt reached the second recipients in the list.
Please help


On Fri, Jan 31, 2014 at 11:27 AM, hari prasadh <[email protected]>wrote:

> def sendEmail():
>         message="hello world"
>         msg = MIMEText(message)
>         msg['Subject'] = 'Message:'+message
>         msg['From'] = '[email protected]'
>         recipients = ['[email protected]','[email protected]']
>         msg['To'] = ", ".join(recipients)
>
>
> #       msg['To'] = '***@***.com'
>         s = smtplib.SMTP('*.*.*.*','25')
>         s.sendmail(msg['From'], msg['To'], msg.as_string())
>
> if __name__ == "__main__":
>         sendEmail()
>
>
> --
> Thanks & Regards,
> HariPrasadh
>



-- 
Thanks & Regards,
HariPrasadh
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to