Free Support Forum - aspose.com

Bug in Creating new emails in a folder- limited to 50

My company has a purchase order in to buy the full version, so right now using the downloaded trial.

To start off with I create a pst, then create a inbox folder with 0 messages in it .

TEST 1:

(1) I then call the below method passing in numberOfMessagesToCreate = 100.

Result: It only creates a total of 50 messages and then no new messages can then be added to that folder.

TEST 2

(2) If I do the following steps:

(A) Pass in numberOfMessagesToCreate= 20, it creates 20

(B) Pass in numberOfMessagesToCreate= 20, it creates 20

(C) Pass in numberOfMessagesToCreate= 20, it creates 10

Result: It only creates a total of 50 messages and no new messages can then be added to that folder.

public void CreateBulkEmails(
FolderInfo FolderToCreateIn,
string FromEmailAddress,
string ToEmailAddress,
string Subject,
string Body,
Int32 numberOfMessagesToCreate,
OnErrorMessage passedInErrorHandler,
OnFeedBackMessage passedInFeedBackHandler
)
{

Int32 messageCount = 0;
passedInFeedBackHandler("Creating Bulk Messages. Please wait.");
screenFeedbackStart = DateTime.Now;
MailMessage mailMsg = null;
MapiMessage outlookMsg = null;

FolderInfo targetFolder = null;

try
{

for (int i = 0; i < numberOfMessagesToCreate; i++)
{

switch (passedInFeedBackHandler != null)
{
case true:

screenFeedbackElapsed = DateTime.Now - screenFeedbackStart;

switch (screenFeedbackElapsed.Seconds >= 4)
{
case true:

screenFeedbackStart = DateTime.Now;
passedInFeedBackHandler("Creating Bulk Message #" + i + ". Please wait.");

break;
}
break;
}

messageCount++;

#region Message Creation

#region Setup MailMessage

// Create an instance of the MailMessage class
mailMsg = new MailMessage();

mailMsg.From = FromEmailAddress;

mailMsg.To = ToEmailAddress;

mailMsg.Date = DateTime.Now;

mailMsg.Subject = Subject;

mailMsg.Body = Body;

#endregion

#region Setup MapiMessage from MailMessage

// Create an instance of the MapiMessage class and pass MailMessage as argument
outlookMsg = MapiMessage.FromMailMessage(mailMsg);

#endregion

//add msg to PSt store
FolderToCreateIn.AddMessage( outlookMsg );

}

#endregion

}
catch (Exception error)
{
switch (passedInErrorHandler != null)
{
case true:

passedInErrorHandler(error.Message);

break;
}
}

switch (passedInFeedBackHandler != null)
{
case true:
passedInFeedBackHandler("Ready");
break;
}

}v

Hi Paul,

Thank you for writing to Aspose support team.

This seems to be an evaluation limitation which are imposed due to absence of license application. Please get a 30-days temporary license free of cost from here and let us know your feedback after trying it at your end.

Was hoping that was the case. The company has put in a purchase order, but these things go as fast a slow moving turtleā€¦

Hi Paul,


Than you for sharing the feedback. Our purchase team will further assist you in getting the order completed. Please let us know if you have any technical query related to the API.