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