2011-02-24 94 views
0

我有这样的逻辑自定义php电子邮件设置?

$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: [email protected]\n"; 
    $headers .= "Reply-To: [email protected]\n"; 
    // $headers .= 'Bcc: [email protected]' . "\r\n"; 
    $headers .= "MIME-Version: 1.0\n"; 
    $headers .= "Content-Type: text/plain; charset=ISO-8859-1\n"; 
    mail($email, $subject, $body, $headers); 

这似乎不错,但有一件事....我可以这样设置

server="smtp.something.net", 
username="[email protected]", 
password="asda.1sda", 
port="587" 

回答

1

的SMTP信息,您可以设置php.ini中的服务器,但用户\密码,因为php的内置邮件不支持身份验证。您应该查看第三方库(phpmailer),因为php mail()函数的电源非常不足。

+0

您可能会注意到SMTP仅在Win32上可用。但是,是的,第三方工具真的是要走的路。还有一个来自PEAR的邮件模块,它可以完成很多工作。 – Cfreak 2011-02-24 19:26:32

相关问题