电子邮件图片未显示 (Gmail)

Ben*_*Ben 5 html email asp.net-mvc gmail image

我用 HTML 编写了一封电子邮件,其中包含一个图像。

图像“src”属性的 URL 指向我的服务器 (ASP.Net) 上的控制器操作端点,该端点返回 FileContentResult。

img 标签的示例如下所示:

<img src="https://www.mywebsite.com/controller/action?argument=value" width="600" height="300" alt="HeadingImage" title="HeadingImage">
Run Code Online (Sandbox Code Playgroud)

电子邮件在 Outlook 中按预期显示。

如果我从 Outlook 获取源代码并在 Chrome 桌面中查看它,它仍然可以正常工作。

如果我在 Chrome 中访问 img URL,则会下载图像。

但是,如果我在 Gmail 中查看电子邮件,图像不会显示。为什么会这样?我在控制台中收到一个类似这样的错误:

ci6.googleusercontent.com/proxy/<SNIP>https://www.mywebsite.com/controller/action?argument=value GET https://ci6.googleusercontent.com/proxy/<SNIP> 404 ()
Run Code Online (Sandbox Code Playgroud)

Sup*_*ser 0

只需添加http://图片即可src

<img src="http://www.mywebsite.com/controller/action?argument=value" width="600" height="300" alt="HeadingImage" title="HeadingImage">
Run Code Online (Sandbox Code Playgroud)