We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

More than 3 inline image are not visible

Hi


I am creating one pst file. in that files i have added 10 inline images but only 1st 3 are visible.
i.e. more than 3 inline images are not visible i pst file.

I am using outlook 2007.

My sample code is as follows
try
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("test001@kerio.com");
mail.To.Add("test001@kerio.com");
mail.Subject = “This is an email”;
String strAllCidString = “”;
for (int i = 1; i < 11;i++ )
{
strAllCidString = strAllCidString + “<img src=cid:”+(i).ToString()+"> <br> 1 inline images <br>";
LinkedResource InlineImage = new LinkedResource(@“C:\Users\maruti\Desktop\New folder\1.png”);
InlineImage.ContentId = (i).ToString();
mail.LinkedResources.Add(InlineImage);

}
AlternateView plainView = AlternateView.CreateAlternateViewFromString(“This is my plain text content”, null, “text/plain”);
AlternateView htmlView1 = AlternateView.CreateAlternateViewFromString("Here is an embedded image. <br> "+strAllCidString, null, “text/html”);

mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView1);
MapiMessage mapi = MapiMessage.FromMailMessage(mail);
PersonalStorage pst = PersonalStorage.Create(@“C:\Users\maruti\Desktop\New folder\InlineImage.pst”, FileFormatVersion.Unicode);
FolderInfo folderInfo = pst.RootFolder.AddSubFolder(“Test Folder”);
folderInfo.AddMessage(mapi);
}
catch(Exception objEx)
{
MessageBox.Show(objEx.Message);
}




Please advise me what shall i do?

Hi Maruti,


Thank you for using Aspose.Email.

I have tried to reproduce this issue at my end using the latest version of Aspose.Email for .NET 3.2.0 but could not get success. I have used the following code sample at my end with a set of 10 images and all these are added to the message very fine. You can test it at your end by creating a folder with the name “Email_11111” in your working folder and place your images in this folder. Please try it at your end and let us know your feedback. I have also attached the created PST here for your reference.

Sample Code

MailMessage mail = new
MailMessage();<o:p></o:p>

mail.From = new MailAddress("test001@kerio.com");

mail.To.Add("test001@kerio.com");

mail.Subject = "This is an email";

string strDir = "EMAIL_11111\\";

DirectoryInfo d = new DirectoryInfo(strDir);

String strAllCidString = "";

foreach(var file in d.GetFiles("*.jpg"))

{

strAllCidString = strAllCidString + "<img src=cid:" + file.Name.ToString() + ">

"
;

LinkedResource InlineImage = new LinkedResource(strDir + file.Name);

InlineImage.ContentId = file.Name.ToString();

mail.LinkedResources.Add(InlineImage);

}

AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content", null, "text/plain");

AlternateView htmlView1 = AlternateView.CreateAlternateViewFromString("Here is an embedded image.
"
+ strAllCidString, null, "text/html");

mail.AlternateViews.Add(plainView);

mail.AlternateViews.Add(htmlView1);

mail.Save(strDir + "Test.msg", MailMessageSaveType.OutlookMessageFormat);

MapiMessage mapi = MapiMessage.FromMailMessage(mail);

PersonalStorage pst = PersonalStorage.Create(strDir + "InlineImage.pst", FileFormatVersion.Unicode);

FolderInfo folderInfo = pst.RootFolder.AddSubFolder("Test Folder");

folderInfo.AddMessage(mapi);


Hi


Sorry to say that but i am using latest version of Aspose dll(3.2.0.0) and .net framework 2.0 and outlook 2007 but still THIS code is not working.

I have attached my pst file with this post.

You can take remote of my machine. I will provide Remote session via Team viewer.

Please give the solutions.

Hi Maruti,


Please have a look at the attached .NET project for your reference and let us know if you still face problem.


Hi

Thank you for the quick reply.
I used your sample application and latest dlls but still an issue is not resolved.
Still same issue is here. Only first 3 inline images are visible in pst file.

I have purchased your licensed copy. please advice me. Thank you.

Hi Maruti,


It seems that there is some issue with your license file as it is imposing evaluation version limitations on adding inline images to the message. Please try the attached temporary license file that I have generated to test this issue and all the images are added properly to the message inline. Please test it at your end (remove .txt from file name) and let us know your feedback.

Hi

Thank you for the reply. It is working fine now. We appreciate your efforts and time for resolving the issue . Thank you for your all team.

Hi Maruti,


Thanks for the feedback. However, the license file shared with you is valid for 1 month only. If this license is working at your end, it means your original license does posses some problem due to which you are getting evaluation limitations. Please verify at your end and let us know your feedback.