I have found a solution:

In the file db.py I have found the following lines:
Line 37-39:

mail.settings.server = 'smtp.gmail.com:587'  # your SMTP server
mail.settings.sender = '[email protected]'         # your email
mail.settings.login = '[email protected]:mygmailpassword'    # your
credentials or None


Line 121-123:

mail.settings.server = settings.email_sender
mail.settings.sender = settings.email_sender
mail.settings.login = settings.email_login


*I do not understand what the purpose of these lines is. I have commented
these lines out and now sending by Gmail works very well.*

# mail.settings.server = settings.email_sender
# mail.settings.sender = settings.email_sender
# mail.settings.login = settings.email_login


And my localhost needs tls=False:

mail.settings.server = 'localhost:25'
mail.settings.sender = '[email protected]'
mail.settings.tls = False
mail.settings.login = None

*By the way: I had to change #*

*"Click on the link http://..."; to *
*"Click on the link https://..."; *

***(lines 88 and 93)*

2010/12/28 Martin Weissenboeck <[email protected]>

> Hi,
>
> I want my website to send emails.
>
> I have tried (in db.py)
>
> mail.settings.server = 'smtp.gmail.com:587'  # your SMTP server
> mail.settings.sender = '[email protected]'         # your email
> mail.settings.login = '[email protected]:mygmailpassword'    # your
> credentials or None
>
>
> and
>
> mail.settings.server = '127.0.0.1'  # your SMTP server
> mail.settings.sender = '[email protected]'         # your email
> mail.settings.login = None    # your credentials or None
>
>
> In both cases I got the message
>
> *WARNING:web2py:Mail.send failure:STARTTLS extension not supported by
> server.*
>
>
> Pure Python works fine:
>
> # python2.7
> >>> import smtplib
> >>> server = smtplib.SMTP('127.0.0.1')
> >>> server.sendmail('[email protected]','[email protected]','test')
>
>
> Operating system: CentOS
>
> What shall I do?
>
> With kind regards
> Martin
>

Reply via email to