dongyumiao5210 2019-04-07 11:25
浏览 145

PHP sendmail不发送@RU域名电子邮件[重复]

This question already has an answer here:

I'm using Laravel 5.8 for web development. I made a short contact form , From where visitors are able to send me email with some data: name, their email, text ect... I'm facing problem with @ru domain emails. They are not delivered into my inbox

Here is my .ENV

MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=achelashvili22@gmail.com
MAIL_PASSWORD=myemailpassword
MAIL_ENCRYPTION=tls

My code in controller:

$from = 'test@testmail.com';
$to = "achelashvili22@gmail.com";
$subject = "Checking PHP mail";
$message = "PHP mail works just fine";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);

My form sends emails normally. Problem appears when I input @ru domain emails. when I change test@testmail.com with any Russian Domain email, for example avtandil1994@mail.ru

I'm getting mail Error in eebmail:

achelashvili22@gmail.com
    host gmail-smtp-in.l.google.com [64.233.184.26]
    SMTP error from remote mail server after end of data:
    550-5.7.1 **Unauthenticated** email from mail.ru is not accepted due to domain's
    550-5.7.1 **DMARC policy**. Please contact the administrator of mail.ru domain if
    550-5.7.1 this was a legitimate mail. Please visit
    550-5.7.1  https://support.google.com/mail/answer/2451690 to learn about the
    550 5.7.1 DMARC initiative. x1si17683973wrm.306 - gsmtp

I have also done this for my email

Allow Access for Unreliable apps

and also using Mailable, but problem remains to be the same.

</div>
  • 写回答

1条回答 默认 最新

  • douan7529 2019-04-07 12:53
    关注

    It's an issue behind the scenes. It is the kind, how your system delivers mail to the world.

    If you have not setup a mail gateway, your system tries to send the mail directly to the mail gate of the receiver; it is identified by the MX record of DNS. And here nearly all mail servers have it own politics, which from and try mails are accepted.

    The better way is to use a gateway to your provider and let it distribute the mails. The provider usually wants an authentication of the client. Therefore see the docu of your provider.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用