PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 10, 2022

[FIXED] How to authenticate emails to prevent gmail mark it as spam

 November 10, 2022     asp.net, dkim, email, nopcommerce     No comments   

Issue

We just open a new e-commerce website and recently noticed Gmail treat our e-mails as spam (notice the red question mark). Our website run behind CloudFlare so the email server IP address is different than the domain.

SPAM marked notice the question mark

We also did not send a bulk email at least not yet. There are some explanations in Google FAQ but not sure what it means or how I need to implement it. Can you please explain how to set these DKIM (preferred) or SPF.

Our website uses nopcommerce (3.70) and developed with ASP.Net.


Solution

Disclaimer: I'm not a "pro" at these things (more later):

  • IMHO, this is probably the simplest explanation of DKIM

  • SPF: in my own words: providing a DNS TXT record that identifies "where" all your emails (smtp/mta servers) can come from. The more complete/formal spec is here

  • You can implement both


Opinionated:

  • SPF is easier to implement

    • identify all the origins of your email, set them in your SPF record, which is a TXT record in DNS
  • DKIM: is more complex - your mail/smtp server/s must implement it.

    As a "web developer" one can see how this would be done in ASP.Net/C#/VB - e.g. sign some payload and using HttClient send some signature in an HTTP header in some outbound request.

    But this is done on an SMTP server, so unless you have one that already implements it, it's something you'll have to do...

IMHO, for DKIM, unless your SMTP/MTA implements it, I'd go for services that provide it. There are 2 types:

  • Transactional email services:

    Not for bulk email. These are the usual "order confirmation" emails, standard support/customer service, etc. emails. They will likely have APIs for you to implement (e.g. sending your MailMessage using thier servers and/or constructing something that equates to it and send that "object" to their API).

  • Bulk email services

    these providers will already have implementations because one of their core value propositions is "deliverability" of your bulk/marketing emails. They should (of course do your due diligence) have both implementations inherently. Will also have their own APIs for bulk email context.

Hth



Answered By - EdSF
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing