이 오류가 발생하는 이유는 무엇입니까? PHPMailer Mail Error - >SMTP connect()
. 어떻게 해결할 수 있습니까?PHPMailer 메일 오류 -> SMTP connect()
$mail->SMTPSecure = "ssl";
하려면 :
$mail->SMTPSecure = "tls";
A I 내가 PHP
<?php
require '../plugins/phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->CharSet = "utf-8";
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "mypass";
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = "587";
$mail->setFrom('[email protected]', 'your name');
$mail->AddAddress('[email protected]', 'receivers name');
$mail->Subject = 'using PHPMailer';
$mail->IsHTML(true);
$mail->Body = 'Hi there ,
<br />
this mail was sent using PHPMailer...
<br />
cheers... :)';
if ($mail->Send()) {
echo "Message was Successfully Send :)";
} else {
echo "Mail Error - >" . $mail->ErrorInfo;
}
?>
사용자 이름이/암호가 정확하지 아니면 Gmail에서 메일을 릴레이에 연결할 수 있도록 준비가되어 있지 않기 때문에 나는 그것이 기대 :
아래에 노력하고 데모를 참조하십시오. 오류가 더 자세한 정보를 제공합니까? 그렇지 않다면 코드에서 오류를 찾아서 –
사용자 이름과 암호를 확인하는 것이 좋습니다. gmail에서 보안에 관한 메일을받습니다. – Pides1937
그건 내 완벽한 오류입니다 : 2016-09-12 07:35:18 \t SMTP 오류 : 서버에 연결하지 못했습니다 : (0) 2016-09-12 07:35:18 \t SMTP connect()가 실패했습니다. https://github.com/PHPMailer/PHPMailer/wiki/ 메일 문제 해결 -> SMTP connect()에 실패했습니다. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting – Pides1937