How can I attach an image in the body content . I have written the below code
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
string
string attachmentPath = Environment.CurrentDirectory + @"\test.png";
Attachment inline = new Attachment(attachmentPath);
inline.ContentDisposition.Inline = true;
inline.ContentDisposition.DispositionType = DispositionTypeNames.Inline;
inline.ContentId = contentID;
inline.ContentType.MediaType = "image/png";
inline.ContentType.Name = Path.GetFileName(attachmentPath);
message.Attachments.Add(inline);
reference: Send an Email in C# with Inline attachments