using core php mail() to send via gmail SMTP

前端 未结 5 933
说谎
说谎 2020-12-09 09:54

Is it possible to send mail in core php via gmail smtp without using any external class?

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 10:36

    If you have access to edit the php.ini then you can do something like this:

    [mail function]
    SMTP = ssl://smtp.gmail.com
    smtp_port = 465
    username = info@Mmydomainname.com
    password = myemailpassword
    sendmail_from = info@mydomainname.com
    

    Alternatively you can do:

提交回复
热议问题