开发者

custom php email settings?

开发者 https://www.devze.com 2023-02-13 11:00 出处:网络
I have this logic $subject = \"something.com Signup - Please do not reply to this email. It was automatically generated.\";

I have this logic

    $subject = "something.com Signup - 
    Please do not reply to this email. It was automatically generated.";
    $body = "A new person has signed up to receive something updates:";
    $headers  = "From: webinquiries@something.com\n";
   开发者_JS百科 $headers .= "Reply-To: something@gmail.com\n";
    // $headers .= 'Bcc: something@something.com' . "\r\n";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "Content-Type: text/plain; charset=ISO-8859-1\n";
    mail($email, $subject, $body, $headers);

which seems ok but one thing.... can i set the smtp info like this

 server="smtp.something.net",
 username="webinquiries@somthing.com",
 password="asda.1sda",
 port="587"


you can set the server in php.ini, but user\password as php's build in mail does not support authentication. you should look at a third party library (phpmailer) as the php mail() function's very under powered.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号