DKIM signature in swift mailer

Viewed 2600

I'm trying to set a DKIM header using swift mailer. The issue is that when I inspect the email in Gmail the DKIM status is 'FAIL'. According to https://mxtoolbox.com and few other tools the TXT record for DKIM is correct. The SPF and DMARC records are OK (even for Gmail).

Here's the part of the code where I set the

$privateKey = file_get_contents('/path/to/the/private.key');
$domainName = 'mydomain.name';
$selector = 'default';
$signer = new Swift_Signers_DKIMSigner($privateKey, $domainName, $selector);

$swift_message = Swift_SignedMessage::newInstance();
$swift_message->attachSigner($signer);

Any ideas?

1 Answers
Related