Send DKIM signed mails from PHP?
<p>I'm currently sending email messages such as password reset emails or confirmations and notifications from my website through <a href="http://php.net/manual/function.mail.php" rel="nofollow noreferrer">PHP's <code>mail()</code> function</a>. </p>

<p>I'm already specifying <code>Return-path</code> and <code>Reply-to</code> headers. I'm sending emails like this:</p>

<pre class="lang-php prettyprint-override"><code>$to = "someone@gmail.com";
$subject = "Hello";
$body = "Blah blah blah";
$from = "rocketnuts@example.com";
$headers = "From: Rocketnuts &lt;$from&gt;\nReturn-path: $from\nReply-to: $from\n";
mail( $to, $subject, $body, $headers, "-f$from" );
</code></pre>

<p>This works fine, but to reduce the risk of these emails ending up in spam folders, I would like to send <strong>DKIM-signed emails</strong>. </p>

<p>Is this possible with PHP's mail() function, or should I use some 3rd party package? (which?)</p>

<p>When searching around, I see questions like "sending DKIM signed emails to Outlook.com" but I want a <em>general</em> solution, not something for specific recipient domains. </p>

<p>Just in case: I'm only sending emails from addresses @ the actual domain where my PHP scripts are running, and I have access to its DNS records.</p>