【问题标题】:Gmail Email Markup not WorkingGmail 电子邮件标记不起作用
【发布时间】:2015-03-28 19:16:45
【问题描述】:

我正在测试 Gmail 的 Email Markup functionality for Parcel Deliveries,但似乎我做错了。这是sending an e-mail to myself之后的邮件内容:

Return-Path: <test.email@gmail.com>
Received: from my-pc.local ([my.ip.add.ress])
        by mx.google.com with ESMTPSA id 68sm3737559qgz.8.2015.01.29.06.06.37
        for <test.email@gmail.com>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 29 Jan 2015 06:06:38 -0800 (PST)
Date: Thu, 29 Jan 2015 11:06:33 -0300
From: "Test Name" <test.email@gmail.com>
To: test.email@gmail.com
Subject: Your package is on its way
Message-ID: <20150129140633.GA18059@my-pc.local>
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)

<html>
  <body>
    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "ParcelDelivery",
      "deliveryAddress": {
        "@type": "PostalAddress",
        "streetAddress": "Test Address",
        "addressLocality": "Test locality",
        "addressRegion": "Test Region",
        "addressCountry": "CL",
        "postalCode": "7551234"
      },
      "expectedArrivalUntil": "2015-02-12T12:00:00-04:00",
      "carrier": {
        "@type": "Organization",
        "name": "Test org"
      },
      "itemShipped": {
        "@type": "Product",
        "name": "iPod Mini"
      },
      "partOfOrder": {
        "@type": "Order",
        "orderNumber": "176057",
        "merchant": {
          "@type": "Organization",
          "name": "Test Org 2"
        },
        "orderStatus": "OrderInTransit"
      },
      "trackingUrl": "http://track.com/track/1234567890",
      "trackingNumber": "1234567890"
    }
    </script>
    <p>Test paragraph</p>
  </body>
</html>

根据markup validator,标记是有效的。我缺少一些推荐的(但不是必需的)字段。添加它们没有帮助。

到目前为止,我也尝试过微数据格式,但没有成功:

<html>
  <body>
    <div itemscope itemtype="http://schema.org/ParcelDelivery">
      <div itemprop="deliveryAddress" itemscope itemtype="http://schema.org/PostalAddress">
        <meta itemprop="streetAddress" content="Test Address"/>
        <meta itemprop="addressLocality" content="San Francisco"/>
        <meta itemprop="addressRegion" content="CA"/>
        <meta itemprop="addressCountry" content="US"/>
        <meta itemprop="postalCode" content="94107"/>
      </div>
      <meta itemprop="expectedArrivalUntil" content="2015-01-12T12:00:00-08:00"/>
      <div itemprop="carrier" itemscope itemtype="http://schema.org/Organization">
        <meta itemprop="name" content="Test Carrier"/>
      </div>
      <div itemprop="itemShipped" itemscope itemtype="http://schema.org/Product">
        <meta itemprop="name" content="iPod Mini"/>
      </div>
      <div itemprop="partOfOrder" itemscope itemtype="http://schema.org/Order">
        <meta itemprop="orderNumber" content="176057"/>
        <div itemprop="merchant" itemscope itemtype="http://schema.org/Organization">
          <meta itemprop="name" content="Bob Dole"/>
        </div>
        <meta itemprop="orderStatus" content="OrderInTransit"/>
      </div>
      <meta itemprop="trackingUrl" content="http://track.com/track/1234567890"/>
      <meta itemprop="trackingNumber" content="1234567890"/>
    </div>
    <p>Test paragraph</p>
  </body>
</html>

我错过了什么?

我正在使用 mutt 发送电子邮件:

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

或者没有内容类型:

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

【问题讨论】:

  • 我有同样的问题,微数据通过了验证器,但即使向自己发送电子邮件,它们也会被丢弃。我昨天在我的 DNS 中添加了一条 SPF 记录,但我认为自测不需要它 (developers.google.com/gmail/markup/testing-your-schema)。
  • 我最终设法做到了。我必须添加 SPF 记录并将 google IP 2a00:1450:4010:c07::264 标记为允许的发件人。我猜是因为我使用了 google SMTP 中继。
  • @AntoinePinsard 谢谢,我一定会试试看的。
  • 实际上,IP 并不总是相同的,它只是偶尔起作用。如果您使用 google SMTP 中继,您的 DNS 记录应如下所示:600 IN TXT "v=spf1 a include:_spf.google.com ~all"

标签: html email gmail json-ld


【解决方案1】:

如果您使用 Google SMTP 中继,则必须使用如下所示的 SPF 记录:

600 IN TXT "v=spf1 a include:_spf.google.com ~all"

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

【讨论】:

  • 您能详细说明一下吗?我面临同样的问题,请
【解决方案2】:

标记看起来不错。不过,您需要使用 DKIM 或 SPF 对您的邮件进行身份验证(请参阅https://developers.google.com/gmail/markup/registering-with-google#email_sender_quality_guidelines)。实现此目的的最简单方法是使用 Gmail 的 SMTP 服务器,而不是您自己的。

【讨论】:

  • 我正在使用 Gmail 的 SMTP 服务器,这是一个示例 smtp 日志:Jan 29 16:40:13 host=smtp.gmail.com tls=on auth=on user=test.email@gmail.com from=test.email@gmail.com recipients=test.email@gmail.com mailsize=1447 smtpstatus=250 smtpmsg='250 2.0.0 OK 1422560413 50sm7879005qgj.12 - gsmtp' exitcode=EX_OK。不过,我在原始电子邮件内容中找不到 DKIM 签名。
  • 我假设 test.email@gmail.com 不是您的真实地址!?尝试使用您的真实地址。
  • 我用 test.email@gmail.com 替换了所有出现的真实地址
  • 自 1 月以来有关于此错误的任何消息吗?因为我的完全一样。
  • 现在 5 年多过去了,我面临着完全相同的问题,没有解决方案。 SPF 和 DKIM 工作正常。标记签出。还尝试通过 Google SMTP 发送,仍然没有。
猜你喜欢
  • 2016-10-22
  • 2014-06-03
  • 1970-01-01
  • 2015-12-03
  • 2015-04-09
  • 1970-01-01
  • 1970-01-01
  • 2017-01-22
  • 1970-01-01
相关资源
最近更新 更多