Archived Forum Post

Index of archived forum posts

Question:

Max limit of emails downloaded by CopyMail?

Oct 17 '14 at 10:55

(Working Environment : C#,Silverlight,WCF service hosted by Windows.)

I am trying to retrieve the bounce emails using Chilkat.MailMain.CopyMail() method, I would like to mention that we want message body and message header of emails for our requirement that’s why we forced to use CopyMail() method.

So my query is that how many emails can be copied in email bundle from SMTP i.e. “What is the maximum limit of emails that can be retrieved from SMTP ?”.

In my case the method is taking long time to retrieve the emails and service gets stop even I have set the maximum time limit for the service.


Answer

First a few points for clarification:

1) SMTP is a protocol for sending email, not for downloading email. When you fetch email from the mail server using the Chilkat MailMan object, it is via the POP3 protocol. (Chilkat's IMAP class is used for the IMAP protocol.)

2) You are not forced to use CopyMail just because you want both header and body. There are numerous alternative functions for downloading email. Some download headers-only. Some download the full emails. Some of the methods that download full emails are: CopyMail, FetchEmail, FetchMime, FetchByMsgNum, FetchMultiple, FetchMimeByMsgnum, GetFullEmail.


What is the Maximum Limit?

There is no maximum limit. Calling CopyMail is not a good idea for a large number of emails for two reasons: It requires a large amount of memory to return them all at once within an email bundle object, and it would take a long time and if the operation is disrupted for any reason (perhaps caused by external network issues), then there is no way to resume. You would need to restart from the beginning. For large numbers of messages, it's better to download and process either one at a time, or in chunks at a time. This keeps memory consumption stable, and also allows your app to resume if there is some sort of failure.