Hello everyone.
I am quite desperate. I can not send email using
smtp.gmail.com. Nothing seams to be working. I use a gmail smtp account which is working fine on my server when I use a basic python script, or even a php script on my Apache 2.4. But is not not working with Web2py. I do not have the 2 identification activated on gmail.
What i did :
I created a news application. In the db.py file, I have put the following lines :
from gluon.tools import Auth, Service, PluginManager
auth = Auth(db)
service = Service()
plugins = PluginManager()
## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)
## configure email
mail = auth.settings.mailer
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'eXX...@gmail.com'
mail.settings.login = 'eXX...@gmail.com:XXXXX'
In the default.py file, I just put the following line :
def index():
mail.send('eXX...@gmail.com','Subject','Message')
response.flash = T("Hello World")
return dict(message=T('Welcome to web2py!'))
I have not error messages, but no mail was sent.
Any idea ?
Thank you very much.
------------------
Version
2.14.6-stable+timestamp.2016.05.10.00.21.47
(Running on Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/7.0.10 mod_wsgi/4.4.12 Python/2.7.10, Python 2.7.10)