html – Gmail电子邮件标记不工作

前端之家收集整理的这篇文章主要介绍了html – Gmail电子邮件标记不工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在测试Gmail的 Email Markup functionality for Parcel Deliveries,似乎我无法理解.这是 sending an e-mail to myself后的电子邮件内容
  1. Return-Path: <test.email@gmail.com>
  2. Received: from my-pc.local ([my.ip.add.ress])
  3. by mx.google.com with ESMTPSA id 68sm3737559qgz.8.2015.01.29.06.06.37
  4. for <test.email@gmail.com>
  5. (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
  6. Thu,29 Jan 2015 06:06:38 -0800 (PST)
  7. Date: Thu,29 Jan 2015 11:06:33 -0300
  8. From: "Test Name" <test.email@gmail.com>
  9. To: test.email@gmail.com
  10. Subject: Your package is on its way
  11. Message-ID: <20150129140633.GA18059@my-pc.local>
  12. MIME-Version: 1.0
  13. Content-Type: text/html; charset=us-ascii
  14. Content-Disposition: inline
  15. User-Agent: Mutt/1.5.23 (2014-03-12)
  16.  
  17. <html>
  18. <body>
  19. <script type="application/ld+json">
  20. {
  21. "@context": "http://schema.org","@type": "ParcelDelivery","deliveryAddress": {
  22. "@type": "PostalAddress","streetAddress": "Test Address","addressLocality": "Test locality","addressRegion": "Test Region","addressCountry": "CL","postalCode": "7551234"
  23. },"expectedArrivalUntil": "2015-02-12T12:00:00-04:00","carrier": {
  24. "@type": "Organization","name": "Test org"
  25. },"itemShipped": {
  26. "@type": "Product","name": "iPod Mini"
  27. },"partOfOrder": {
  28. "@type": "Order","orderNumber": "176057","merchant": {
  29. "@type": "Organization","name": "Test Org 2"
  30. },"orderStatus": "OrderInTransit"
  31. },"trackingUrl": "http://track.com/track/1234567890","trackingNumber": "1234567890"
  32. }
  33. </script>
  34. <p>Test paragraph</p>
  35. </body>
  36. </html>

标记根据markup validator有效.建议(但不是必填)我缺少的字段.添加它们没有帮助.

我还试过微数据格式,没有运气到目前为止:

  1. <html>
  2. <body>
  3. <div itemscope itemtype="http://schema.org/ParcelDelivery">
  4. <div itemprop="deliveryAddress" itemscope itemtype="http://schema.org/PostalAddress">
  5. <Meta itemprop="streetAddress" content="Test Address"/>
  6. <Meta itemprop="addressLocality" content="San Francisco"/>
  7. <Meta itemprop="addressRegion" content="CA"/>
  8. <Meta itemprop="addressCountry" content="US"/>
  9. <Meta itemprop="postalCode" content="94107"/>
  10. </div>
  11. <Meta itemprop="expectedArrivalUntil" content="2015-01-12T12:00:00-08:00"/>
  12. <div itemprop="carrier" itemscope itemtype="http://schema.org/Organization">
  13. <Meta itemprop="name" content="Test Carrier"/>
  14. </div>
  15. <div itemprop="itemShipped" itemscope itemtype="http://schema.org/Product">
  16. <Meta itemprop="name" content="iPod Mini"/>
  17. </div>
  18. <div itemprop="partOfOrder" itemscope itemtype="http://schema.org/Order">
  19. <Meta itemprop="orderNumber" content="176057"/>
  20. <div itemprop="merchant" itemscope itemtype="http://schema.org/Organization">
  21. <Meta itemprop="name" content="Bob Dole"/>
  22. </div>
  23. <Meta itemprop="orderStatus" content="OrderInTransit"/>
  24. </div>
  25. <Meta itemprop="trackingUrl" content="http://track.com/track/1234567890"/>
  26. <Meta itemprop="trackingNumber" content="1234567890"/>
  27. </div>
  28. <p>Test paragraph</p>
  29. </body>
  30. </html>

我失踪了什么

我使用mutt发送电子邮件

  1. mutt -e "set content_type=text/html" test.email@gmail.com -s "Your package is on its way" < test.html

或没有内容类型:

  1. mutt test.email@gmail.com -s "Your package is on its way" < test.html

解决方法

如果您使用Google SMTP中继,则必须使用如下所示的SPF记录:
  1. 600 IN TXT "v=spf1 a include:_spf.google.com ~all"

资料来源:https://support.google.com/a/answer/178723?hl=en

猜你在找的HTML相关文章