PHPmailer
작품을 연결할 수 없습니다,하지만 난 생산으로 움직일 때, 나는 이런 종류의 오류가 무엇입니까 : 나는 TLS와 SSL 모두를 시도했습니다PHPMailer 내 로컬 호스트에서 잘 해주 서버
Connection: opening to smtp.gmail.com:587, timeout=300, options=array () 2016-09-28 12:58:01 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Connection timed out) 2016-09-28 12:58:01 SMTP ERROR: Failed to connect to server: Connection timed out (110) 2016-09-28 12:58:01 SMTP connect() failed.
을, 그에 따라 포트를 업데이트합니다. 또한 나는 빠른 nmap은 스캔을 실행했습니다, 그리고 그이 내 응용 프로그램에서 미리보기입니다
PORT STATE SERVICE
25/tcp filtered smtp
443/tcp open https
465/tcp open smtps
587/tcp open submission
문제가되지 않습니다 그래서 포트가 제대로 열려 있는지 보여
public function __construct() {
parent::__construct();
$this->isSMTP();
$this->SMTPAuth = true;
$this->SMTPSecure = 'tls';
$this->Host = MAIL_HOST;
$this->Username = MAIL_USERNAME;
$this->Password = MAIL_PASSWORD;
$this->From = 'myemail';
$this->FromName = 'Name';
$this->addEmbeddedImage('../public/img/message_logo.png', 'logo');
$this->isHTML(true);
$this->Port = 587;
$this->Subject = "SUBJECT";
$this->SMTPDebug = MAIL_SMTP_DEBUG;
}
사람이 무엇을 알고는 다음에 확인해 볼까?
보안 수준이 낮은 앱 액세스 허용 (https://support.google.com/accounts/answer/6010255) 했습니까? – simon
네, 문제없이 로컬 호스트의 메일을 보내고 있다고 말했기 때문에 – fugitive