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

-- 
Thanks & Regards,
HariPrasadh


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

> Hi All,
>
> Tried with subprocess,it worked
> def findThisProcess( process_name ):
>   ps     = subprocess.Popen("ps -ef |grep "+process_name+"|egrep -v
> 'sh|grep'|awk -F ' ' {'print $2'}", shell=True, stdout=subprocess.PIPE)
>   output = ps.stdout.read()
>   ps.stdout.close()
>   ps.wait()
>
>   print output
>
>
>
> On Thu, Jan 30, 2014 at 2:12 PM, Udaya Kumar <[email protected]> wrote:
>
>> On Wed, Jan 29, 2014 at 6:16 PM, hari prasadh <[email protected]
>> >wrote:
>>
>> > In python
>> > >>> import os
>> > >>> os.popen("ps -ef |grep jboss").read()
>> > 'root     24452 24425  0 17:34 pts/0    00:00:00 sh
>> > /root/jboss-as-7.1.1.Final/bi\nroot     24593 24592  0 17:34 pts/0
>> >  00:00:00 sh -c ps -ef |grep jboss\nroot     24595 24593  0 17:34 pts/0
>> >  00:00:00 grep jboss\n'
>> >
>> >
>> >
>> It might be due to terminal width. Try setting it with os.environ. Also
>> popen is deprecated, use subprocess.
>> _______________________________________________
>> ILUGC Mailing List:
>> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
>> ILUGC Mailing List Guidelines:
>> http://ilugc.in/mailinglist-guidelines
>>
>
>
>
> --
> 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