C# Bulk Mail Download With only 4 mails downloaded

  • Автор темы Автор темы peterzhou
  • Дата начала Дата начала

peterzhou

Client
Регистрация
06.04.2011
Сообщения
61
Реакции
15
Баллы
8
Код:
Развернуть Свернуть Копировать
// download all messages from yandex via POP3 and add results to the table
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("superuser@yandex.ru", 
       "ххххххххххх", "pop.yandex.ru", 995, true,
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3, 
       24*100, 20, false);
 
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
    // adding messages to the table called Tabl1
    // tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
      List<string> tmp = new List<string>();
       tmp.Add(tuple.Item1);
       tmp.Add(tuple.Item2);
       tmp.Add(tuple.Item3);
       tmp.Add(tuple.Item4);
       project.Tables["Tabl1"].AddRow(tmp);
}

When I use this to my email and save Tabl1 to aaa.xlsx, I got only 4 mails. I have a lot of mails in my email account. What is the problem(I know little C#)?
 
Maybe the issue has a solution in this line?

Код:
Развернуть Свернуть Копировать
ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3, 24*100, 20, false);

From the wiki I see "24*100" is a parameter for:

lastHours
Type: System.Int32
If message older than specified amount of hours will not be returned. Default value is 2 hours

On the wiki there is no mention of the units used for the parameter in "lastHours". Does anyone know what 24*100 relates to? 24hrs x 100 ?


Also the maxCount paramter interger "20", in this line (EmailProtocol.POP3, 24*100, 20, false), should exceed the expected number of emails to download. At the moment, you would only be downloading 20 mails per run, if my read is correct.

I'm not familiar with c#, but on the basis of experience with other lanuages, the "foreach" loop & "ZennoPoster.BulkMailDownload" need error/exception handling boilerplate to output to ZP log Class. At the moment, it looks like the code would swallow exceptions/errors.
 
Код:
Развернуть Свернуть Копировать
ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3, 24*100, 5000, false);

In this code 24*100 Means 24 Hrs and 100 days.If message older than specified amount of hours will not be returned..

5000 Means BulkMailDownloader Download Max 5000 Messages from Mail Server..

False Means BulkMailDownloader will not delete Messages in Mail Server..

you can modify these settings in code what you want..!

i tested using this code working good..!!:D
 
  • Спасибо
Реакции: peterzhou

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)