내 사이트에 이메일 확인을 보내려고했습니다. 사람들은 문제없이 등록 할 수 있으며 모든 것이 데이터베이스에 등록되지만 전자 메일은 보내지 않습니다. 나는 그것을 정상적으로 시도했고 smtp 서버에 대한 약간의 오류를 주었다. 그래서 누군가 SurgeMailer를 시도해야한다고 말했다. 나는 그것을 다운로드하고, 지금 전자 우편은 실제로 그들이 보낸 것을 말한다, 그러나 전자 우편은 결코 그 (것)들을받지 않는다. 어떤 도움이라도 좋을 것입니다! 전자 메일을 보내는 코드를 작성합니다.PHP를 통해 메일 보내기
/*Send Email here*/
$to=$Email;
$subject="Newgenstudios Account Confirmation";
/*From*/
$header="From:Newgenstudios <[email protected]>";
/* Your message */ /*Not Finished */
$message = "<h3>Welcome to the site ".ucfirst(strtolower($First_Name))."!</h3>
<p>To complete your account registration, you must activate your account. Click on the link below or paste it into the URL to activate your account.</p>
<p><a href='http://localhost/confirmation.php?passkey=$confirm_code'>Activate Now!</a </p>
<p>Once your account has been activated, you may log in at anytime using the information you supplied below:<br />
<strong>Email: </strong>$Email<br />
<strong>Password: </strong>$Password</p>
<p>Other Information:</p>
<strong>Name: </strong>$First_Name<br />
<strong>Phone: </strong>$Phone<br />
<p>Thank you for registering and see you on the site!</p>
<p>Did you not register? Then please disregard this message.</p>";
/* Send Email */
$sentmail = mail($to,$subject,$message,$header);
}
/*If not found*/
else {
echo "Not found your email in our database";
}
/* email succesfully sent */
if($sentmail){
echo "Your Confirmation link Has Been Sent To Your Email Address.";
}
else {
echo "Cannot send Confirmation link to your e-mail address";
}
?>
오류가 있는지 로그 파일을 확인하십시오. PHP'mail()'함수는 메일이 보내 졌음을 보장하지 않으며 배달을 위해서만 받아 들여졌다. – j08691
btw HTML 전자 메일을 보내려면 MIME-TYPE 및 Content-type을 정의해야합니다. 페이지 하단의 예 : http://www.w3schools.com/php/func_mail_mail.asp – christopher
MIME-TYPE 및 Content-Type은 포함 할 필요가 없습니다. 그것은 어쨌든 보낼 것입니다. @ user1868065 서버에서/var/log/maillog를 확인하고 거기에 오류가 있는지 확인하십시오. 서버에 액세스 할 수 없다면 SwiftMailer를 사용하고 IMAP과 같은 방법으로 다른 메일 서버를 통해 연결해보십시오. – ChrisG