Problem sending email with new web2py version on Apache 2.4

47 views
Skip to first unread message

e27...@gmail.com

unread,
Jun 4, 2017, 12:42:14 PM6/4/17
to web2py-users

After upgrading to the last version of Web2py, along which the latest Apache 2.4, we are unable to send email any more. Note that we have access to this remote server only through a browser for our Web2py development.

We have tested different login/passwords/IP (gmail, orange, free) on port 587 which all work fine when put in a regular scripts outside Web2py environment. But in a Web2py controller, no mail is sent, and the mail.send() object keeps returning "false".

I have installed the latest Web2py version on my personal PC, and could send email successfully with exactly the same controller : 

    mail = auth.settings.mailer
    mail.settings.server = '
smtp.gmail.com:587'
    mail.settings.sender = '
XX...@gmail.com'
    mail.settings.tls = True
    mail.settings.ssl = False
    mail.settings.login = 'XX...@gmail.com:YYYYY'
    mes = mail.send(to='
XX...@gmail.com', subject='Test', message='Message')

    if mes:
        response.flash = ("Mail sent !")
    else:
        response.flash = ("Mail not sent !")

    return locals()

 

Two comments at that point : 

 

1/ The latest Web2py version apparently requires now  'mail.settings.ssl = True'. Otherwise it will no work.

 

2/ The web2py console is very helpful to see the warning messages and understand what is going on after attempting to send an email. For instance :

 


 

Here are my questions :

 

1/ How can we have access to the warning messages above when we are only using a browser with no direct access on the distant machine ? The debug features are not relevant since there is no bug in the controller.

 

2/ What code should I add in the controller to log or see those warnings ?

 

3/ It looks like the problem I have could be related to SSL or other protection possibly in the lasted Apache version. Do you have idea ?

 

We would be very grateful to have an answer from you or somebody of your development team. Could you please also teel me how I could have access to the discussion group.

 

Thank you
 

Thierry.

 

Dave S

unread,
Jun 5, 2017, 1:50:48 PM6/5/17
to web2py-users
Reply all
Reply to author
Forward
0 new messages