Hi,
Hi Sathyapriya,
String path = “”;<o:p></o:p>
MailMessage SampleMsg = new MailMessage();
SampleMsg.Subject = "Test Email 5.7 with Linked resource in AlternateView";
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content", null, "text/plain");
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is an embedded image.", null, "text/html");
LinkedResource logo = new LinkedResource(path + @"Desert.jpg", MediaTypeNames.Image.Jpeg);
logo.ContentId = "companyLogo";
htmlView.LinkedResources.Add(logo);
SampleMsg.IsBodyHtml = true;
SampleMsg.AlternateViews.Add(plainView);
SampleMsg.AlternateViews.Add(htmlView);
//Set From, To, ReplyToList
SampleMsg.From = new MailAddress("user1@gmail.com");
SampleMsg.To.Add(new MailAddress("user2@gmail.com"));
MailAddressCollection coll = new MailAddressCollection();
coll.Add(new MailAddress("user3@gmail.com"));
//msgReply.ReplyToList = coll;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587,"user1@gmail.com", "password", SecurityOptions.SSLExplicit);
client.Send(SampleMsg);
Thank you for the details.
Hi Sathyapriya,
Please can you share the sample code.
Hi,
Thank you.
Hi,
I could get this working by saving the message and loading it again. Please could you let me know if aspose mail could interpret the html body and associated files created using Microsoft.Office.Interop.Word library. If it is possible please could you share a sample code that could do this.
Hi,
Attached is the sample HTML and the associated files generated by Word interop.
Hi Sathyapriya,