Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tnort's avatar
Level 4

Laravel emails show as spam

Hi all,

I've just set up a Laravel application in production that uses supervised queues to handle emails. But received emails are highlighted as possible spam, in Gmail at least.

Could it be a problem that MAIL_FROM_ADDRESS in the .env is different from the email data I set for the MAIL_USERNAME?

Would you please be kind to help troubleshoot this issue please?

Thank you!

0 likes
14 replies
Sinnbeck's avatar

@tudosm my first bet is that it's due to spf. Can you share the domain?

1 like
tnort's avatar
Level 4

@Sinnbeck, I get 7/10. Failing for "You're not fully authenticated"

  Your message is not signed with DKIM
[SPF] smarteducationpro.co.uk does not allow your server 212.227.126.133 to use [email protected]

And it also says I was put in two blacklists Listed in SORBS (last 28 days) ( -0.5 )

1 like
Akash_kushwaha's avatar

@tudosm

  1. SPF prevents spammers from sending unauthorized messages that appear to be from your domain.

  2. Receiving servers use DKIM to verify that the domain owner actually sent the message. Important: Gmail requires a DKIM key of 1024 bits or longer.

You need both of them to be Authorised. if you don't want your mails to go in to spam.

1 like
Sinnbeck's avatar

@tudosm yeah you need to get this properly set up. I use mailgun myself, and they help set up everything :)

Sinnbeck's avatar

Can you show your env config (hide passwords)

1 like
tnort's avatar
Level 4

@Sinnbeck, sure

MAIL_MAILER=smtp
MAIL_HOST=smtp.ionos.co.uk
MAIL_PORT=587
MAIL_USERNAME="f2b37f087bbf5c-dsa2123sa"
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Akash_kushwaha's avatar

@tudosm It's batter to use any email service because some domains are not SPF or the DKIM authenticated. because of that your mail goes into spam.

1 like
Akash_kushwaha's avatar

@tudosm Yes, there are many emails services with free plans. So you can choose other if you want like sendinblue , mailchimp and many more.

Please or to participate in this conversation.