2017-01-19 21 views
0

我試圖測試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

我已經調整方案和HTML是驗證返回0錯誤和0建議,SPF是確定的; DKIM是好的;但沒有任何結果 –

+0

類似的問題在這裏:http://stackoverflow.com/questions/41258309/email-markup-gmail-modifying-the-script-tag-to-add-extra-string-3d –

回答

0

通常情況下,這個問題發生,如果你的HTML是無效的。嘗試再次使用validator

如果您使用Google SMTP中繼,則必須使用基於此support page的SPF記錄:600 IN TXT "v=spf1 a include:_spf.google.com ~all"

您可以檢查此相關話題:Gmail Email Markup not Working

+0

我已經調整方案和驗證器返回0錯誤和0的建議,SPF是好的; DKIM是好的;但沒有任何結果 –