我有一個郵件腳本工作正常,我無法弄清楚是什麼改變了這不會導致「發」通過。
我有這樣的代碼在郵件功能
$to = ($_POST['email']);
$subject = 'Welcome to the Team!';
$url = 'mydomain.com';
$headers = "From: [email protected]\r\n";
$headers = "BCC: [email protected]\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
...
mail($to, $subject, $message, $headers);
的問題是,當電子郵件來過, 「從」 是這樣的:
來源:(MYDOMAIN)@( someLetters,方法&號).shr.phx3。(爲myhost).NET
的,而不是...
這是怎麼回事?
全代碼更新
...
if(count($errors) == 0) {
$to = '[email protected]';
$subject = 'Subject';
$headers = "From: [email protected] mydomain.com\r\n";
$headers = "BCC: [email protected] mydomain.com\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "<html><body>…Email Message 1…</body></html>";
mail($to, $subject, $message, $headers);
}
if(count($errors) == 0) {
$to = ($_POST['email']);
$subject = 'Subject';
$url = 'mydomain.caom';
$headers = "From: [email protected] mydomain.com\r\n";
$headers = "BCC: [email protected] mydomain.com\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "<html><body>…Email Message 2…</body></html>";
mail($to, $subject, $message, $headers);
echo '<META HTTP-EQUIV=Refresh CONTENT="1; URL='.$url.'">';
}
@B麥卡錫,因爲你只是覆蓋你的'$ headers'每時間,試着將它與'$ headers.'連接起來,參見後面的'.'。 –