我试图测试simpel电子邮件标记。测试人员通过一些建议验证标记,但没有错误。我使用简单的脚本并发送给自己。但是,仍然无法识别标记。不需要DKIM和SPF,但配置和控制。我做错了什么?
脚本:
function testMarkup() {
var htmlBody = HtmlService.createHtmlOutputFromFile('test').getContent();
MailApp.sendEmail({
from: Session.getActiveUser().getEmail(),
to: Session.getActiveUser().getEmail(),
subject: 'Test' + new Date(),
htmlBody: htmlBody,
});
}
的test.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>dfgdfgdgdgg</title>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "FoodEstablishmentReservation",
"reservationNumber": "OT12345",
"underName": {
"@type": "Person",
"name": "John Smith"
},
"reservationFor": {
"@type": "FoodEstablishment",
"name": "Wagamama",
"telephone": "044755755755",
"address": {
"@type": "PostalAddress",
"streetAddress": "1 Tavistock Street",
"addressLocality": "London",
"addressRegion": "Greater London",
"postalCode": "WC2E 7PG",
"addressCountry": "United Kingdom"
}
},
"startTime": "2017-04-10T08:00:00+00:00",
"partySize": "2",
"reservationStatus": "confirmed",
"modifiedTime": "2013-11-03T21:00:00+01:00",
"modifyReservationUrl": "https://example.com/linktomodification"
}
</script>
</head>
<body>
<p>
This a test for a Restaurant reservation Google Now card in Gmail.
</p>
</body>
</html>
答案 0 :(得分:0)
通常,如果您的HTML无效,就会出现此问题。请再次使用validator。
如果您使用Google SMTP中继,则必须使用基于此support page的600 IN TXT "v=spf1 a include:_spf.google.com ~all"
的SPF记录。
您可以查看此相关主题:Gmail Email Markup not Working