Requirement : need to send eml file with inline images to desired emaqil ids using Aspose.
Steps
1> Read eml file with inline images
2> send it to desired email id via email.
Development ( pseudo Code )
1> Created a console application
2> Added Aspose.email as reference.
3> added Aspose.email.lic ( Licence ) as embedded Resource.
4> In console , written following code .
Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense("Aspose.Email.lic");
MailMessage msg = MailMessage.Load("TestEmlFile.eml");
msg.From = "User1@Aspose.com";
msg.To = "User2@aspose.com";
Aspose.Email.Mail.SmtpClient client = new SmtpClient("Server Name");
client.AuthenticationMethod = SmtpAuthentication.None;
client.Send(msg);
5> Not getting any email when executed this code.
6> When used follwoing code
Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense("Aspose.Email.lic");
MailMessage msg = MailMessage.Load("TestEmlFile.eml");
msg.From = "User1@Aspose.com";
msg.To = "User2@aspose.com";
MailMessage N_Msg = new MailMessage ();
N_Msg.Subject = msg.Subject;
N_Msg.TextBody = msg.TextBody;
foreach (Attachment a in msg.Attachments)
{
N_Msg.Attachments.Add(a);
}
N_Msg.Body = msg.Body;
N_Msg.HtmlBody = msg.HtmlBody;
N_Msg.Date = msg.Date;
N_Msg.To = msg.To;
N_Msg.CC = msg.CC;
N_Msg.Bcc = msg.Bcc;
N_Msg.From = msg.From;
Aspose.Email.Mail.SmtpClient client = new SmtpClient("Server Name");
client.AuthenticationMethod = SmtpAuthentication.None;
client.Send(N_Msg);
7> We got an email , but with no inline images . This code works fine for other scenarios except inline images.