【问题标题】:Outlook.com sender image not shownOutlook.com 发件人图像未显示
【发布时间】:2018-12-03 23:18:34
【问题描述】:

当我收到来自银行或 Skype 的电子邮件时,我会在缩略图中看到他们的图片以及电子邮件的一行简介。

通过 nodejs 服务器通过 sparkpost(电子邮件发送服务)以编程方式发送电子邮件时,如何让我的公司徽标显示在缩略图中?

【问题讨论】:

  • I see their image in the thumbnail - 电子邮件有缩略图?什么电子邮件客户端?
  • @JaromandaX I think he means like this? 在发件人姓名旁边显示徽标的位置。
  • 我的邮件客户端都没有这样做,这就是我问这个问题的原因:p
  • 你能提供一个你想要做什么的例子,或者你能确认它就像@David的例子
  • 我的意思是这样 - imgur.com/a/Knh1nQy

标签: javascript node.js email smtp sparkpost


【解决方案1】:

你需要做一个内联图像。为此,您可以将图像转换为 base64,然后将内容包含在图像标签中。

这是一个示例,它将通过 SparkPost 在电子邮件中发送一个红点 PNG。

curl -X POST \
  https://api.sparkpost.com/api/v1/transmissions \
  -H 'Authorization: [YOUR_API_KEY_HERE]' \
  -H 'cache-control: no-cache' \
  -d '{
    "options": {
        "open_tracking": true,
        "click_tracking": true
    },
  "campaign_id": "test",
  "recipients": [
    {
      "address": {
        "email": "to@example.com",
        "name": "To recipient"
      }, 
        "tags": []
    }
  ],
  "content": {
    "from": {
      "email": "from@example.com",
      "name": "From address"
    },
    "subject": "My Sample Subject",
    "text": "Test",
    "html": "<p>Test</p> <img src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\" alt=\"A Red dot\" />"
  }
}

'

有很多方法可以将图像转换为 base64,但这里有一个示例: https://www.base64-image.de/

【讨论】:

  • 是的,我想要这样的东西 - imgur.com/a/Knh1nQy(outlook.com 上的电子邮件预览)
猜你喜欢
  • 2013-06-24
  • 2019-11-06
  • 1970-01-01
  • 1970-01-01
  • 2017-07-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多