PHP : send mail in localhost

后端 未结 4 648
-上瘾入骨i
-上瘾入骨i 2020-11-27 06:24

I would like to send email through php code hosted locally.



        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 06:39

    try this

    ini_set("SMTP","aspmx.l.google.com");
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
    $headers .= "From: test@gmail.com" . "\r\n";
    mail("email@domain.com","test subject","test body",$headers);
    

提交回复
热议问题