I tried to send the email with an image in the body of email, the image is not an attachment.
I read the image from the media item in sitecore and i got the url of the image like https://domain/-/media/image.ashx next step i convert to email body using LinkedResource like below code
System.Net.Mail.LinkedResource imageResource = new System.Net.Mail.LinkedResource(imageUrl, "image/jpg"); imageResource.ContentId = "HDIImage"; System.Net.Mail.AlternateView htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString("<image src=cid:" + imageResource.ContentId + ">" + textbody, null, "text/html"); htmlView.LinkedResources.Add(imageResource);
System.Net.Mail.LinkedResource imageResource = new
System.Net.Mail.LinkedResource(imageUrl, "image/jpg");
imageResource.ContentId = "HDIImage";
System.Net.Mail.AlternateView htmlView =
System.Net.Mail.AlternateView.CreateAlternateViewFromString("<image src=cid:" +
imageResource.ContentId + ">" + textbody, null, "text/html");
htmlView.LinkedResources.Add(imageResource);
but iI have exception like the image path is not given correctly.