Sending a mail with image in the message body

EmailMessage message = new EmailMessage(exchangeService);
message.Subject = "test";
message.Attachments.AddFileAttachment(@"test.bmp");
message.Attachments[0].ContentId = test.bmp@123;
message.Attachments[0].IsInline = true;

message.Attachments[0].ContentLocation = path; //Image path


Without content location and ContentId we will not get the image in the message body.


Make sure you add the Content ID in the HTML to get the image.

Comments

Popular posts from this blog

Network Security: LAN manager authentication level

Cisco AnyConnect Secure Mobility Client - VPN service not available. The VPN agent service is not responding