简体   繁体   English

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

[英]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. 我在服务器A上托管了一个网站。我使用Cloudflare服务,因此无法从同一服务器向我的用户发送邮件。 I have server B for mail sending. 我有用于邮件发送的服务器B。 Installed Exim and configured it as follows: 安装了Exim并将其配置如下:

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: 在serevr AI上,使用Phpmailer发送邮件:

$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. 试图将$ mail-> SMTPAuth更改为“ true”,但这无济于事。

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. 您没有发布太多信息来继续,但是很可能阻止了到端口25的出站通信-查看是否可以从服务器A telnet serverb 25 。通常无论如何您都不能通过端口25发送(中继),但是请改用端口587上的外部经过身份验证的提交主机。 You should try reading the troubleshooting guide which covers all kinds of connection issues. 您应该尝试阅读故障排除指南 ,其中涵盖了各种连接问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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