i am trying send email using web2py with gmail and using smtp setting i have attached all code

前端 未结 4 699
别那么骄傲
别那么骄傲 2021-01-27 09:04

i am trying to create a form in web2py which sends message to an email account on submission mainly i used SQLFORM.factory to create the form then i used gluon.tools import mai

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-27 09:20

    All the issues I have experienced with sending email ("unable to send email") from Web2Py via Gmail, have been caused by the 2-steps authentication which was enabled on my gmail account.

    In order for Web2Py to be able to send email via gmail:

    1. Read Google instructions at https://support.google.com/mail/answer/1173270?hl=en
    2. When logged in with your gmail account, go to https://security.google.com/settings/security/apppasswords?pli=1 and enter the once-only pwd Google provides with the app you intend to allow use the gmail services (I have mentioned "Web2Py")
    3. In the model where the mail services are defined - use exactly what's recommended in the W2P book with the new pwd mentioned above - and it works !

    NeoToren

提交回复
热议问题