-1
내 문제를 해결하기 위해 여러 시간 동안 검색했지만 실패했습니다.메일러 오류로 인해 오류 발생 : SMTP connect()가 실패했습니다.
이 XAMPP에 Gmail
으로 이메일을 보내이 오류 때마다 얻을 수 PHPMailer 내 간단한 코드를 사용 입니다 :
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
을이 내 PHP 코드입니다 :
<?php
require_once('PHPMailer/PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->HOST = 'smtp.gmail.com';
$mail->PORT = '465';
$mail->isHTML();
$mail->Username = '##myemail##@gmail.com';
$mail->Password = '##mypass##';
$mail->SetFrom('[email protected]');
$mail->Subject = 'Hello World';
$mail->Body = 'A test email!';
$mail->AddAddress('[email protected]');
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
?>
도와주세요.
위키를 확인 했습니까? https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#smtp-error-could-not-connect-to-smtp-host – modsfabio
아마도 당신은 인증 오류가 있지만'$ mail-> SMTPDebug = 2 '오류를 알려주십시오. – Linek
[PHPMailer, SMTP connect()에서 Gmail에 오류가 발생했습니다.] (http://stackoverflow.com/questions/25924651/phpmailer-smtp-connect-failed-error-with-gmail) – Synchro