파일에서 https://github.com/PHPMailer/PHPMailer 오류 : 메시지가 전송되지 않았습니다 .. 메일 오류 : SMTP connect()가 실패했습니다.메시지를 보내지 못했습니다 .. 메일러 오류 : SMTP 연결() 실패했습니다
require_once('./class.phpmailer.php')
$mail = new PHPMailer()
$mail->IsSMTP()
$mail->Host = "smtp.gmail.com"
$mail->Port = "465"
$mail->SMTPAuth = "true"
$mail->SMTPSecure = "ssl"
$mail->Username = "[email protected]"
$mail->Password = "password"
//build the message
$mail->IsHTML(true)
$mail->From = "[email protected]"
$mail->AddAddress("[email protected]")
$mail->Subject = "An HTML Message"
$mail->Body = "Hello, <b>my friend</b>! \n\n This message uses HTML entities!"
if($mail->Send()) {
echo 'Message is sent'
}
else {
echo 'Message was not sent..'
echo 'Mailer error: ' . $mail->ErrorInfo
}
방화벽 차단 포트. 또는 잘못된 포트/프로토콜/등을 사용했습니다. – tripleee
명령 줄 (cmd.exe)을 열고 텔넷으로 연결을 시도하십시오. telnet smtp.gmail.com 465 – ryrysz