ZennoLab Assemblies Documentation
BulkMailDownload Method
Example 

Type: System.String

The login for mail (usualy your email address).

Type: System.String

The password for mail.

Type: System.String

The mail server. Default value is blank, ZennoPoster will try to determine your the settings.

Type: System.Int32

The server port. Default value is 143

Type: System.Boolean

true if use SSL; otherwise, false. Default value is true

Type: ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol

IMAP or POP3. Default value is IMAP.

Type: System.Int32

If message older than specified amount of hours will not be returned. Default value is 2 hours

Type: System.Int32

Max count of messages. Default value is 100.

Type: System.Boolean

true if remove messages; otherwise, false. Default value is false.

Downloads the messages from the specified account.
Syntax
public static Tuple<string,string,string,string>[] BulkMailDownload( 
   string login,
   string pass,
   string server,
   int port,
   bool useSSL,
   EmailProtocol protocol,
   int lastHours,
   int maxCount,
   bool deleteMessages
)

Parameters

login

Type: System.String

The login for mail (usualy your email address).

pass

Type: System.String

The password for mail.

server

Type: System.String

The mail server. Default value is blank, ZennoPoster will try to determine your the settings.

port

Type: System.Int32

The server port. Default value is 143

useSSL

Type: System.Boolean

true if use SSL; otherwise, false. Default value is true

protocol

Type: ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol

IMAP or POP3. Default value is IMAP.

lastHours

Type: System.Int32

If message older than specified amount of hours will not be returned. Default value is 2 hours

maxCount

Type: System.Int32

Max count of messages. Default value is 100.

deleteMessages

Type: System.Boolean

true if remove messages; otherwise, false. Default value is false.

Return Value

Type: System.Tuple

tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message with headers, tuple.Item4 - text message with headers

Example
The following example shows call the BulkMailDownload method.
// download all messages from gmail via IMAP
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("[email protected]", 
       "ххххххх", "imap.gmail.com", 993, true,
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.IMAP, 
       24*100, 20, false);
 
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
    // TODO Something useful with messages
    // tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
}
// download all messages from gmail with auto settings detection for last 100 days.
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("[email protected]", "хххххххххх", lastHours: 24*100);
 
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
    // TODO Something useful with messages
    // tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
}
// download all messages from yandex via POP3 and add results to the table
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("[email protected]", 
       "ххххххххххх", "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);
}
Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

Reference

ZennoPoster Class
ZennoPoster Members

Send Feedback