problem in sending mail

241 views
Skip to first unread message

sonu kumar

unread,
Dec 4, 2013, 4:34:07 PM12/4/13
to web...@googlegroups.com
Hi All,
I am not able to send email via my application.
here is my code..I don't know where I am doing mistake, but it is working fine with gmail setup.

from gluon.tools import Mail
mail = Mail()
mail.settings.server = 'xx.x.x.xx:25'
mail.settings.sender = 'ad...@xyz.org'
mail.settings.login = None

as my IT dept told me that this smtp does not need any login...this smtp direct send mail and it is working fine for them. But I don't know why it is not working for me...Is there any mistake I am doing in my code??

Thanks

Alan Etkin

unread,
Dec 4, 2013, 5:48:00 PM12/4/13
to web...@googlegroups.com

as my IT dept told me that this smtp does not need any login...this smtp direct send mail and it is working fine for them. But I don't know why it is not working for me...Is there any mistake I am doing in my code??

After mail.send(), check the values for mail.result and mail.error

sonu kumar

unread,
Dec 4, 2013, 5:55:59 PM12/4/13
to web...@googlegroups.com
Hi Alan,
I checked as you said..it gives
mail.result ={}
mail.error = gaierror(-2, 'Name or service not known')

sonu kumar

unread,
Dec 4, 2013, 6:23:43 PM12/4/13
to web...@googlegroups.com
Thanks Alan.
It is working now..with this script

from gluon.tools import Mail    
mail = Mail()
mail.settings.server = 'localhost'
mail.settings.sender = 'x...@xxx.org'
mail.settings.login = None
mail.settings.tls = None

thanks
Reply all
Reply to author
Forward
0 new messages