How to configure php.ini to use gmail as mail server

前端 未结 4 1240
野趣味
野趣味 2021-02-04 10:50

I want to learn yii as my first framework. And I\'m trying to make the contact form work. But I got this error: \"alt

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 11:42

    If you open the php.ini file in WAMP, you will find these two lines:

    smtp_server
    smtp_port
    

    Add the server and port number for your host (you may need to contact them for details)

    The following two lines don't exist by default:

    auth_username
    auth_password
    

    So you will need to add them to be able to send mail from a server that requires authentication. So an example may be:

    smtp_server = mail.example.com
    smtp_port = 25
    auth_username = example_username@example.com
    auth_password = example_password
    

    ps: you should not use your personal mail here. for an obvious reason.

提交回复
热议问题