Normal emails send from outlook pass DKIM test, but when using script DKIM fails (dkim=fail (signature did not verify)). When using Gmail DKIM passes, outlook doesnt. 3 months ago it also passed outlook, i think that zend messes up the email header, but how to restore that?
try {
$body = 'Bedankt voor uw bericht.<br>';
$body .= $text;
$body .= '<br><br>Met vriendelijke groet, Maintenanceplus';
$html = new MimePart($body);
$htmlPart->charset = "UTF-8";
$html->type = "text/html";
$body = new MimeMessage();
$body->setParts(array($html,));
// Create E-mail message
$message = new Message();
$message->addTo($recipient)
->addFrom('jilcoATmaintenanceplus.nl')
->setSubject('Maintenanceplus - contact')
->setBody($body)
->setEncoding("UTF-8")
->setSender("jilcoATmaintenanceplus.nl")
//->setHeaders($headers)
->addCc("jilcoATmaintenanceplus.nl");
// Send E-mail message (SMTP)
$transport = new SmtpTransport();
$options = new SmtpOptions(array(
'name' => 'maintenanceplus.nl',
'host' => '###',
'port' => 587,
'connection_class' => 'login',
'connection_config' => array(
'username' => '###',
'password' => '###',
'ssl' => 'tls',
),
));
$transport->setOptions($options);
$transport->send($message);
$result = true;
} catch(\Exception $e) {
$result = false;
}
// Return status
return $result;