0
我不能讓這段代碼工作我知道如何使用PHP的郵件部分,並不能明白什麼是錯的。PHP的電子郵件不能發送與激活密鑰
##Send activation Email
$to = $_POST['email'];
$subject = " YOURWEBSITE.com Registration";
$message = "Welcome to our website!\r\rYou, or someone using your email address, has completed registration at YOURWEBSITE.com. You can complete registration by clicking the following link:\rhttp://www.YOURWEBSITE.com/verify.php?$activationKey\r\rIf this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ YOURWEBSITE.com Team";
$headers = 'From: [email protected]';
mail($to, $subject, $message, $headers);
什麼是錯誤?或者,什麼不工作? – janenz00
@ janenz00它不會發送電子郵件。 – maxgee
mail()函數很難調試(只返回true或false),是否可能出現服務器設置問題?在Linux上,通常您可以在/ var/log/messages中檢查日誌 – Pandaski