How to c# Embed Base64 Image for Emailing?

2019-06-06 17:53发布

I am currently using a string to embed a base64 image in email via EWS but the embeded images is not showing up in my outlook client when i receive the email.

If i save the email source it is viewable in my browser.

static string str = @"<head><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /></head><body><img src=""data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="" /></body></html>";

Is it possible to embed images into a HTML email message in this method?

Best Regards

Chris

标签: c# html parsing
1条回答
Juvenile、少年°
2楼-- · 2019-06-06 18:56

Data URI scheme may be not supported by the receiving party: What is Data URI support like in major email client software?

Consider using MIME related (cid protocol) to send html email with embedded images. I believe it is far better supported. I'm not sure if it can be easily done with SmtpMail.

查看更多
登录 后发表回答