laravel application that uses gmail smtp all email goes to spam
I have an email called info@mydomain.com, I created it using G Suite and I use it on my .env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=info@mydomain.com
MAIL_PASSWORD=""
MAIL_ENCRYPTION=tls
I have set txt record with value v=spf1 mx -all
I have MX record with mail server 'mydomain.com'
any ideas please?
1 Reply
The recommended spf record for G Suite is:
v=spf1 include:_spf.google.com ~all
Source: https://support.google.com/a/answer/33786?hl=en
If you have set the MX record for mydomain.com to mydomain.com, but are using gmail, spf fails and mail is likely to end up in spam if not silently deleted. This is especially true when using -all
instead of ~all
.