cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PHPMailer fails to send email by external smtp server

I use following to send an email by phpmailer, but it fails. Error message is:  

 

2018-08-30 03:45:51 SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

 

But it worked in other hosting from other provider. 

 

PHP code: 

$mail->SMTPDebug = 2; 
$mail->isSMTP(); 
$mail->Host = 'smtp.ym.163.com'; 
$mail->SMTPAuth = true; 
$mail->Username = 'amoywolf@easytalkee.com';
$mail->Password = 'mypassword';
$mail->SMTPSecure = 'ssl'; 
$mail->Port = 994; 

 

 

1 REPLY 1

Re: PHPMailer fails to send email by external smtp server

I searched posts here for whole day, then tried following code. It can work to send email to a @hotmail.com email a/c, but while sending email to @qq.com or @163.com email a/c, there is no error from the code, but there is not email received. I appreciate if anyone would help.

 

$mail->Host = 'localhost';
$mail->SMTPAuth = false;
$mail->Username = "";
$mail->Password = "";
$mail->SMTPSecure = false;
$mail->Port = 25;