I'm hoping to use a gmail address I have to send e-mails through a web2py app.
Currently I can only send e-mails to other gmail addresses and the "From" gets re-written to "fromaddress@gmail.com" while I want it to be "From Address Name" which is what I have from my gmail settings.
Also, if I set the headers through web2py it doesn't work, it just gets rewritten. So to summarise the problems are
1) I can only send emails to @gmail.com 2) I can't get the correct from header.
Here is my code:
# E-mail
gmail = Mail()
gmail.settings.server = 'smtp.gmail.com:587'
gmail.settings.sender = 'from@gmail.com'
gmail.settings.login = 'from@gmail.com:password'
# gmail.settings.tls = True
gmail.send( to=['to@gmail.com'] , subject='Hello1' , message='world' , headers={ 'From':'me' } )