php - Swiftmailer DKIM fails only with multipart email -
i'm attempting dkim working swiftmailer php. works , dkim passes when setting body once (html or text), when adding both parts "body hash did not verify" dkim fail.
does know correct way sign email both html , text parts using swiftmailer?
// create signer $privatekey = file_get_contents($dkimprivatekeylocation); $domainname = 'from.here'; $selector = 'default'; $signer = new swift_signers_dkimsigner($privatekey, $domainname, $selector); $signer->ignoreheader('return-path'); // create message $message = swift_signedmessage::newinstance(); // attach signer $message->attachsigner($signer); // message setup $message->setfrom('email@from.here'); $message->setto('email@to.here');
html passes
$message->setsubject('dkim html test'); $message->setbody('<p>hello world</p>', 'text/html','utf-8');
text passes
$message->setsubject('dkim text test'); $message->setbody('hello world', 'text/plain','utf-8');
html , text fails
$message->setsubject('dkim html , text test'); $message->setbody('<p>hello world</p>', 'text/html','utf-8'); $message->addpart('hello world', 'text/plain','utf-8');
i'm not sure i'm doing wrong, swiftmailer documentation little sparse i'm not sure try next. have tried both simple , relaxed types body canon no success.
Comments
Post a Comment