无法从服务器B上的服务器A + Exim上的phpmailer发送邮件

无法从服务器B上的服务器A + Exim上的phpmailer发送邮件

问题描述:

I have a website hosted on server A. I use Cloudflare services, so I can not send mails to my users from the same server. I have server B for mail sending. Installed Exim and configured it as follows:

internet site, mail is sent and received directly using SMTP
Machines to relay mail for: [IP address of the server A]

On serevr A I use Phpmailer to send mail:

$mail->IsSMTP();
$mail->SMTPAuth   = false;
$mail->SMTPSecure = "";
$mail->Host       = "IP address of server B";
$mail->Port       = 25;
$mail->Username   = "";
$mail->Password   = "";

Unfortunately, it doe snot work. Tried to change $mail->SMTPAuth to "true" but it does not help.

SMTP Error: Could not connect to SMTP host.

You've not posted much info to go on, but it's likely that outbound traffic to port 25 is blocked - see if you can telnet serverb 25 from server A. Normally you can't send out (relay) through port 25 anyway, but use an external authenticated submission host on port 587 instead. You should try reading the troubleshooting guide which covers all kinds of connection issues.