Hello there,
I am sending Html document(containing Images) as an email attachment at run-time using C#.
But when I check the email received, html document that was sent doesn't contain any image.
Can you please guide how can I make sure that html documents are sent along with images.
MailMessage objMailMessage = new MailMessage();
objMailMessage.From = new MailAddress("[email protected]");
string[] emailIds = objReportRequest.EmailIds.Split(',');
foreach (string emailId in emailIds)
{
objMailMessage.To.Add(new MailAddress(emailId));
}
objMailMessage.IsBodyHtml = true;
objMailMessage.Body = messageBody;
objMailMessage.Subject = "Test Service";
objMailMessage.Attachments.Add(new Attachment(filePath));
SmtpClient objSmtpClient = new SmtpClient("smtp.gmail.com");
objSmtpClient.Credentials = new NetworkCredential("[email protected]", "aaa");
objSmtpClient.EnableSsl = true;
objSmtpClient.Send(objMailMessage);
I am receiving the html doc as an email attachment but images are not displayed.
Thank you!