如何通过服务器别名邮件发送电子邮件

时间:2021-12-29 18:15:44

I've create a script that used the ipn of PayPal. All working perfectly, after the purchasing the data of the clients are inserted in the database. But recently the server of my hosting provider doesn't send the email. I don't understand the reason. I'm trying so to create an alias email server for send the email of contact form through the alias mail and it's working! Now i want replicate the license send with alias mail server, actually i send the email with this code:

我创建了一个使用PayPal的ipn的脚本。在购买客户数据后,所有工作都完美地插入数据库中。但最近我的托管服务提供商的服务器不发送电子邮件。我不明白原因。我正在尝试创建一个别名电子邮件服务器,通过别名邮件发送联系表单的电子邮件,它正在工作!现在我想用别名邮件服务器复制许可证发送,实际上我用这段代码发送电子邮件:

*$headers = 'From: '.$AdminEmail . "\r\n" .
    'Reply-To: '.$AdminEmail . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers)*

In the past this code working good but now doesn't working more. How can send the email through the alias server mail?

在过去,这段代码运行良好但现在不能正常工作。如何通过别名服务器邮件发送电子邮件?

1 个解决方案

#1


0  

Outcome of the discussion in the comments is that your provider restricts you from changing the from: field for email sent from you php scripts.

评论中讨论的结果是您的提供商限制您更改从您的PHP脚本发送的电子邮件的from:字段。

As a result of this, you need to use a external mail server that allows you to do so or talk to your provider if they can provide another (probably paid) solution.

因此,您需要使用允许您这样做的外部邮件服务器,或者如果他们可以提供另一个(可能是付费的)解决方案,则可以与您的提供商交谈。

#1


0  

Outcome of the discussion in the comments is that your provider restricts you from changing the from: field for email sent from you php scripts.

评论中讨论的结果是您的提供商限制您更改从您的PHP脚本发送的电子邮件的from:字段。

As a result of this, you need to use a external mail server that allows you to do so or talk to your provider if they can provide another (probably paid) solution.

因此,您需要使用允许您这样做的外部邮件服务器,或者如果他们可以提供另一个(可能是付费的)解决方案,则可以与您的提供商交谈。