Inline images are not working for Aspose.email.mail.mailmessage using eml file

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.

Hi Nilesh,


Thank you for sharing your concerns with us.

I have tested this issue with the latest version of Aspose.Email for .NET 4.1.0 by sending email from one Gmail account to another Gmail account. The email is not only received properly at the receiving end but it also contains the Inline image whether the license is initialized or not. I have attached a sample project here for your reference with credentials for two gmail accounts. Could you please test it at your end and let us know your feedback? (both the accounts have the same password).