Question

My website example1.com is hosted on host.example2.com and when I send an email message via PHP mail() function from example1.com. It always has a 'via' host.example2.com stamp in Gmail when people receive the message.

I found this: http://support.google.com/mail/bin/answer.py?hl=en&ctx=mail&answer=1311182

Seems I need to:

  1. Use an SPF record - which I have done, and it's now correctly showing "Received-SPF: pass" in the email header.
  2. Sign my messages by DKIM3 to be authenticated as truly from example1.com

And I scoured through http://www.dkim.org/ to find nothing about how to do it in PHP.

Any idea how I can use DKIM3 for my email messages sent via PHP mail()? Thanks!

Was it helpful?

Solution

http://php-dkim.sourceforge.net/ seems to be a PHP implementation of DKIM. The download contains a PHP library and detailed documentation.

Note that Gmail may not immediate stop displaying the "via" thing even if you implement DKIM. Google seems to use other heuristics to decide when to show "via" and when not to show it, and they're rather reluctant to disclose exactly what you need to do. But DKIM will go a long way toward assuring Google that you're not a spammer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top