问题
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