Django email goes to spam

Hello,
I’m sending email with link to reset user password and it always goes to spam folder.
My email setup

EMAIL_USE_TLS=True
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_USER=myemail@gmail.com
EMAIL_HOST_PASSWORD=my_password
EMAIL_PORT=587

Have you got some tips how to solve this issue>

Use a real mail service, like Sendgrid, rather than your personal Gmail.

Can I use SMTP or their APIs or it doesn’t matter ?

doesn’t matter, but I prefer SMTP because it’s provider agnostic

1 Like

@adamchainz, I decided to use this email service https://www.mailgun.com and even my own domain but it still goes to spam. What can I do more ?

Is it emails that you are sending to yourself that are going to spam, or emails that you are sending to others?

Some email providers will automatically route emails to spam that are “coming from yourself” because that’s a common technique for sending spam.

If this is emails that you are sending to yourself, set up a different email account for yourself on a different provider and try sending emails to that.

I use SMTP to send emails over Mailgun email provider to my personal Gmail account (it goes to spam), but when I send to my work email (Outlook) it works fine. I’m confused why gmail treat my emails as spam.

What email address are you using as the “From” address? Your gmail address? If so, that’s one potential source of the issue.

No, as I said, I use Mailgun and my own domain. So the answer is no I don’t use my gmail as the “From” address. The “From” address is like team@MY_DOMAIN.com

Did you add your team@my_domain.com as a contact in your gmail account?

(Side note: This definitely isn’t a Django issue. Django has no control over the disposition of emails on the receiving end. It’s gmail that is sending the email to your spam folder. You’d have to dig through the resources available to you to determine exactly why gmail is routing it to spam.)

Side note: I run a mail server myself on my own domain. That doesn’t prevent me from sending emails using any arbitrary domain as the “From” name.

Thank you very mych, as you said It wasn’t issue with Django. I change email html template and now everything works fine.

how did you changed the template style for not going it to spam?

1 Like

did you get any resolution for this?