Free Support Forum - aspose.com

Long Execution time for retrive message

Hello,

I' m a developer of the alfaproject.

I' m testing the aspose.email v 2.7.0.0 to purchase it.

The target is develop a Windows Service that run in background and download messages stored in a Exchange folder.

This is the code of my application:

Private Sub DownloadAllEmail(ByVal FolderName As String, Optional ByVal mode As ExchangeListMessagesOptions = ExchangeListMessagesOptions.ListRecursive)

Try

Dim ExchangeConnection As ExchangeWebServiceClient

ExchangeConnection = New ExchangeWebServiceClient(Settings.ConnectionServer, _

             Settings.ConnectionUsername,

_<o:p></o:p>

Settings.ConnectionPassword, _<o:p></o:p>

Settings.ConnectionDomain)

Dim FolderURI As String = ExchangeConnection.MailboxInfo.InboxUri

Dim MessageCollection As ExchangeMessageInfoCollection = _

            ExchangeConnection.ListMessages(FolderURI,

mode)<o:p></o:p>

For Each MessageInfo As ExchangeMessageInfo In MessageCollection

Dim StringMessageURI As String = MessageInfo.UniqueUri

Dim message As Aspose.Email.Mail.MailMessage = ExchangeConnection.FetchMessage(StringMessageURI)

Dim tempMessage As String = EmailFolder & "Message_" & message.Date.ToString("yyyyMMddhhmmss") & EmailExtension

message.Save(tempMessage, Aspose.Email.Mail.MessageFormat.Eml)

Next

ExchangeConnection.Dispose()

Catch ex As Exception

LogOperation("[DownloadAllEmail]: " & ex.Message, EventLogEntryType.Error)

End Try

End Sub

The execution time is over 10 minutes for retrive 135 message from a single folder ( Too much).

Often the connection with the server is dropped and this is a problem.

Are these behaviours due by trial version?

Thanks.



Hi Arianna,


Thank you for considering Aspose.Email.

After an initial investigation, I was also able to observe this issue at my end and I am further investigating this issue with different net speeds. I’ll soon share my findings here with further details and proceed accordingly then.

Hi Arianna,


Thank you for your patience.

I further investigated this issue and the results were variant based on the contents of the emails in the mailbox. When the FetchMessage statement executes, it fetches the entire contents of the message and if an email contains huge contents, e.g. 20 MB of attachments, ofcourse it will take time to fetch entire contents of the email. Could you please tell us if your emails are that much loaded with contents as this doesn’t take much time for emails containing text only.