How to configure PHP to send e-mail?

后端 未结 8 1577
星月不相逢
星月不相逢 2020-12-10 07:12

I need to send mail to the users of my website using php script. I have tried using mail function in php.
My code is as follows:

  $to = \"myweb@gmail.co         


        
8条回答
  •  醉梦人生
    2020-12-10 07:24

    configure your php.ini like this

    SMTP = smtp.gmail.com
    
    [mail function]
    ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
    
    ; SMTP = smtp.gmail.com
    
    ; smtp_port = 465
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    ;sendmail_from = postmaster@localhost
    

提交回复
热议问题