简体   繁体   中英

Cannot send mail from phpmailer on server A + Exim on server B

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 AI 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM