我正在尝试在提交表单时发送电子邮件.我正在使用PHPMailer使用以下配置发送邮件.
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'mail.example.in';
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = 'user@example.in';
$mail->Password = 'password';
$mail->setFrom("user@example.in" , "User");
$mail->addAddress('receiver@example.in', 'Receiver');
$mail->addBCC('anotheruser@somedomain.com', 'Another user');
$mail->AddReplyTo('user@example.in', 'User');
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
if($mail->send())
echo "Your request has been received. We will soon contact you.";
else echo "Unable to send your request. Please try again";
Run Code Online (Sandbox Code Playgroud)
这在localhost中工作正常.但是,当我将它部署到我的服务器(example.in)时,我得到以下异常.
SMTP ERROR: Failed to connect to server: Connection timed out (110)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Run Code Online (Sandbox Code Playgroud)
- 编辑 -
我尝试使用telnet命令连接到SMTP服务器,但我无法添加收件人.我收到以下错误? …
我一直在搜索所有这些,并且无法找到任何文档告诉,为什么人们应该使用快速结账或REST api?
有人可以告诉我这些之间的区别吗?
我需要实现在线支付网关,以便用户购买计划,然后继续在线使用该应用程序(更像是服务).
通过快速结账,我找到了"物理"和"数字"项目类别.我没有向用户提供任何商品(我的应用程序中没有在线商店).
我应该选择什么?请帮忙.