
smtp를 사용하여 phpmailer를 통해 메일을 보내려고 합니다. 동일한 사용자 이름과 비밀번호로 Outlook에서 사용하고 있는 호스트를 사용하고 있습니다. 오류가 발생합니다. 누구든지 이 문제를 해결하는 방법을 알려줄 수 있습니다.
내 오류:
SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Client host rejected: Access denied
SMTP Error: The following recipients failed: xxxxxxxxx.com Mailer Error: SMTP Error: The following recipients failed: xxxxxxxxxxxx.com
SMTP server error: 5.7.1 : Client host rejected: Access denied
코드는 다음과 같습니다.
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
//$mail->SMTPAuth = true; // authentication enabled
//$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "xxxxxxxxxxxxx";
$mail->Port = "587"; // or 587
$mail->IsHTML(true);
$mail->Username = "xxxxxxxxx";
$mail->Password = "xxxxxxxxxx";
$mail->SetFrom("[email protected]");
$mail->Subject = "Price Change Notification";
$mail->Body = "Test E-mail";
$mail->AddAddress("[email protected]");
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}
else{
echo "Message has been sent";
}
답변1
어떤 메일 서버를 실행하고 있는지 모르면 구체적으로 말하기는 어렵지만 많은 사람들은 승인된 IP 주소에서만 메일을 보낼 수 있도록 메일 서버를 잠급니다. 여기도 그런 것 같습니다. 메일 서버를 관리하는 사람에게 문의하여 웹 서버에서 메일을 보낼 수 있도록 허용해 달라고 요청해야 합니다.
답변2
당신이 블랙리스트에 없는지 찾아보세요:
답변3
위의 문제를 파헤친 사람이 있을 경우를 대비해 사용자 이름이 SetFrom
주소와 동일한지 확인하세요. 일부 메일 서버 구성에서는 다른 보낸 사람 주소를 허용하지 않습니다. 다른 옵션은 실제 메일 계정에 메일 별칭을 추가하는 것입니다.