0

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.

user11281949
  • 105
  • 6

1 Answers1

0

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.

Wiimm
  • 2,971
  • 1
  • 15
  • 25