PHPのmail()関数の使用に問題があります。単に送信されません。
私は次のとおりです。
//email them new password
$recipient = $actual_email; //recipient
$subject = "Reset Password"; //subject = reason for contacting
// To send HTML mail, the Content-type header must be set
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: Website <do-not-reply-reset@domain.co.nz>\r\n"; //headerfields
$mail_body = "
<html>
<head>
<title>Reset Password</title>
</head>
<body>
<h2>Reset Password</h2>
<p>Hello $actual_email<br />
You recently asked to reset your password.</p>
<p>Your reset password is below:<br />
<br />
<b>$string</b></p>
<br />
<p>It is recommended you copy and paste this password into the login page, and change your password under settings, then delete this email.</p>
<p>If you did not request this change of password, it is recommended you login and change your password immediately, and get in contact with us.</p>
<p>Thank you,<br />
The Team
<br />
NOTE:<br />
Please do not reply to this message, which was sent from an unmonitored e-mail address. Mail sent to this address cannot be answered.</p>
</body>
</html>";
//send mail
if(mail($recipient, $subject, $mail_body, $headers)){ //mail command
header('Location: index.php?success=yes');
exit;
} else {
$error_message = "<div class='error'>
<img src='http://resources.domain.co.nz/backgrounds/icon_error.png' class='messageimg' />
<h4>Error - Recovery Error</h4>
<p>There was an error sending a recovery password. If the problem persists, please contact us directly.</p>
</div>";
}
sendmailがUNIXのデフォルトの場所にインストールされ、PHP.iniで正しく参照されていることを確認しました。
以前にこれと同じコードを使用したことがあり、問題はなかったので、サーバー側のものだと思いますか?
助けていただければ幸いです。