on commad line or using python shell

This code works find and I can get email

from gluon.tools import Mail

# now we want to send email
mail = Mail()
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'v...@gmail.com'
mail.settings.login = 'v...@gmail.com:pass'

mail.send()

But in when controller default.py when i call fucntion 


def test():


mail = Mail()
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'v...@gmail.com'
mail.settings.login = 'v...@gmail.com:pass'

mail.send()


It does not work! I tested all the setting were same!!!


I do not know what is going wrong!!! 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to