Embedded images not showing in outlook while it's showing in Browser?

谁都会走 提交于 2019-12-11 05:27:08

问题


here i am trying to Embeds a image in my outlook but the image is not coming in outlook and when i do the view source and run it as html.image shows. need help.in this code i have convert image to byte base 64. !IMAGE IN OUTLOOK]1 USING 2016 OUTLOOK

private static void SendNotificationEmail(string p_TenantName, string p_TenantEmail, string p_Gmap_code, string p_ThemeEmailFrom, int p_remaindays, int p_contactid, string p_date)
{
Common.Email email = default(Common.Email);
string body = null;
string DexuslogoImage1 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Images\\Dexus_Notce_Logo.png");
string DexuslogoImage2 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images\\DexusTenantNotice.png");
bodys += "src='" + writeImageToString(DexuslogoImage2) +
} 

public static string writeImageToString(string img)
{
    byte[] bytes = File.ReadAllBytes(img);
    dynamic b64String = Convert.ToBase64String(bytes);
    dynamic dataUrl = "data:image/png;base64," + b64String;
    return dataUrl;
}

回答1:


Embedded images aren't supported in Outlook (as well as a few other email clients). It's safest and best practice to reference .jpg|.png|.gif files remotely using <img src="http://www.website.com/path/to/image.jpg">.

Here's a breakdown of email client support for embedded images:

source



来源:https://stackoverflow.com/questions/45008440/embedded-images-not-showing-in-outlook-while-its-showing-in-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!