알림을 제공하기 위해 이메일을 보내는 스크립트가 있지만 SMTP 인증이 아니기 때문에 메일은 곧바로 정크 메일이됩니다. 어떻게하면 인증을 받습니까?Linux, Cent OS에서 SMTP 인증을 사용하여 메일 보내기
나는 다음과 같은 스크립트를 사용하고 있습니다 : 이메일 정크 상자에 갔다 왜
$to = $email . ', '; // note the comma
// subject
$subject = 'MineAlert - Server Down';
// message
$message = '
<html>
<head>
<title>Your server seems to be down, this could be because it has crashed or you have stopped it</title>
</head>
<body>
<p>Your server seems to be down, this could be because it has crashed or you have stopped it</p>
<p>IP: <b>'.$ip.'</b><br>
<p>Port: <b>'.$port.'</b><br>
<p>Reason: <b>Unknown</b><br>
<br>
This email has been generated and sent to you by
</body>
</html>
';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From: [email protected]' . "\r\n";
// Mail it
$mail = mail($to, $subject, $message, $headers);
if (!$mail){
echo "Mail did not send";
} else {
echo "Mail Sent";
}
['mail()'기능] (http://www.hardened-php.net/suhosin/configuration.html#suhosin.mail.protect)에주의하십시오. – sarnold