简体   繁体   English

SendGrid email 是否支持类似于 .NET MailMessage 中的“AlternateViews”的构造?

[英]Does SendGrid email support construct similar to "AlternateViews" in .NET MailMessage?

Web site I work on (written in .NET) generates a lot of reports in HTML format.我工作的 Web 网站(用 .NET 编写)生成大量 HTML 格式的报告。 Some of them have images with the source ("src" attribute) pointing to a local file (ie local to the web site).其中一些图像的源(“src”属性)指向本地文件(即 web 站点的本地文件)。 If a user wants a report to be delivered by email we would convert images into System.Net.Mail.LinkedResource, replace "src" attributes by "src=cid:IdOfResource" and create "AlternateView" on Sytem.Net.Mail.MailMessage.AlternateViews collection.如果用户希望 email 交付报告,我们会将图像转换为 System.Net.Mail.LinkedResource,将“src”属性替换为“src=cid:IdOfResource”并在 Sytem.Net.Mail.MailMessage 上创建“AlternateView” .AlternateViews 集合。 Does SendGrid support such scenario? SendGrid 是否支持这种情况?

Yes, you can embed images in your emails that you send with SendGrid with cid resource URLs.是的,您可以在使用 SendGrid 发送的带有 cid 资源 URL 的电子邮件中嵌入图像。 You can read about how to do that in this article on how to embed images in your emails .您可以在这篇关于如何在电子邮件中嵌入图像的文章中了解如何做到这一点。

I don't know how the .NET "AlternateView" fits into this, but you can certainly embed images in your emails.我不知道 .NET“AlternateView”如何适应这个,但你当然可以在你的电子邮件中嵌入图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM