I already setup postfix in my debian linux VPS. I can send email via ssh console using postfix. I can send email using PHPMailer using my gmail account. I can receive email in my debian linux VPS account.
Then I want to send email using PHPMailer via Postfix using my debian linux vps account. But it's failed with log below.
SERVER -> CLIENT: <br>
CLIENT -> SERVER: EHLO android<br>
SERVER -> CLIENT: <br>
SMTP ERROR: EHLO command failed: <br>
SMTP NOTICE: EOF caught while checking if connected<br>
SMTP Error: Could not connect to SMTP host.<br>
How to send email using PHPMailer using postfix ? should i use sasl ?
My sendmail.php
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Subject = 'hello postfix phpmailer';
$mail->msgHTML(file_get_contents('contentemail.html'), dirname(__FILE__));
$mail->Host = 'yyyy.zzzz.com';
$mail->Username = "xxxx";
$mail->setFrom('xxxx@yyyy.zzzz.com', 'Ceramah Islam');
$mail->addReplyTo('xxxx@yyyy.zzzz.com', 'Ceramah Islam');
$mail->Password = "aaaaaa";
$mail->addAddress('bbbb@gmail.com', 'bbbb');
$mail->send();