简体   繁体   English

php域邮件接收问题

[英]php domain mail receiving issue

I am using php mail function its working fine for gmail but when i send it to domain email it show me successful message but not receive on my domain email side where i am wrong. 我正在使用php邮件功能,适用于gmail,但是当我将其发送到域电子邮件时,它向我显示成功消息,但在域电子邮件方面却收不到我错的地方。 my code is below 我的代码如下

            <?php
            $to=$_POST['to'];
            $from=abc@gmail.com;
            $name="abc";
            $subject=$_POST['subject'];
            $message=$_POST['message'];
            $headers = 'From:'. $name ."\r\n" . 
            'Reply-To:'. $from . "\r\n" . 
            'X-Mailer: PHP/' . phpversion();
            mail($to, $subject, $message, $headers,"-f".$from);
            echo "Message sent! <a href='mail.php'>Click here</a> to send another email.";
            ?>

my domain email is contact@automailer.netai.net how can i fix this issue, 我的域电子邮件是contact@automailer.netai.net,我该如何解决此问题,

There are two completely different processes involved: 涉及两个完全不同的过程:

  • Queueing the mail to your local MTA (This is what PHP's mail() does) 将邮件排队到本地MTA(PHP的mail()这样做的)
  • This MTA delivering (with possible hops in between) to the final MTA, which delivers into the users mailbox 该MTA传递到最终MTA(中间可能有跃点),该MTA传递到用户邮箱中

Obviously PHP only knows about the first step and may be right to consider it successfully done even if something else later goes wrong - eg the receiver domain simply not accepting your mail (which sadly is the new normal). 显然,PHP仅知道第一步,即使以后出现其他问题,也可以认为成功完成是正确的-例如,接收者域根本不接受您的邮件(这是新的常态)。

most likely automailer.netai.net is blacklisted and that's why you aren't getting emails. automailer.netai.net最有可能被列入黑名单,这就是为什么您没有收到电子邮件的原因。

try using phpMailer library which is free or popular smtp api that offer free trial as long yo don't pass 10,000 emails per month from 尝试使用phpMailer库,该库是免费的或流行的smtp api,只要您不从每月通过10,000封电子邮件,就可以免费试用

sendgrid.com , sendgrid.com

maildrill , etc 邮件钻

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

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