Okay, I cant figure this out. I am using PHPMailer to send an email from my domain - example.com to myself. I am sending the email to myself.(testing the google schema markup), but the emails are not authenticated. Here is the code I use to send the email to myself.
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Host = 'tls://smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = '[email protected]';
$mail->Password = '';
$mail->setFrom('[email protected]');
$mail->addAddress('[email protected]');
$mail->Subject = 'Microdata Test';
$html = '
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"description": "Check this out",
"potentialAction": {
"@type": "ViewAction",
"target": "https://www.youtube.com/watch?v=eH8KwfdkSqU"
}
}
</script>
</head>
<body>
<p>
This a test for a Go-To action in Gmail.
</p>
</body>
</html>
';
$mail->msgHTML($html);
$mail->send();
Here is my spf record:
v=spf1 a mx include:mailgun.org include:mydomain.com ~all
reject
. – Blend