이 오류가 발생하면 친절하게 도와주세요.
2015-03-06 10:43:16 SMTP 오류 : 서버에 연결하지 못했습니다 : 대상 컴퓨터가 적극적으로 거부했기 때문에 연결할 수 없습니다. (10061) 2015-03-06 10:43:16 SMTP connect () 실패. 메시지를 보낼 수 없습니다. 메일러 오류 : SMTP connect () 실패.
my code is
<?php
require 'classes/class.phpmailer.php';
require 'classes/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->SMTPDebug = 1; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'localhost'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'root'; // SMTP username
$mail->Password = ''; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->From = '[email protected]';
$mail->FromName = 'usman';
$mail->addAddress('[email protected]', 'usmanxxx'); // Add a recipient
$mail->addAddress('[email protected]'); // Name is optional
$mail->addReplyTo('[email protected]', 'Information');
$mail->addCC('[email protected]');
$mail->addBCC('[email protected]');
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'subject is send email';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
얼마 전에 나는 또한이 문제에 직면했습니다. 서버 관리자도별로 도움이되지는 않지만 내가 이미 한 일에서 확인해야 할 사항입니다.
내가 틀렸다면 나를 바로 잡아주세요.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다