2011-02-24 103 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

相關問題