The Kingthy. Mail component library consists of the following three components:
1. Kingthy. Mail. POP3
Receive mail according to POP3 protocol.
Example: POP3Client client = new POP3Client ("pop.gmail.com", 995, "xx@gmail.com", "xx", true); client. isDebugMode = true; // enable the debugging mode. After the debug mode is enabled, a "pop3trace" is generated in the directory where the dll library is located. log "file client. connect (); int num, size; client. getMailboxStats (out num, out size); if (num> 0) {var list = client. getMailList (false); foreach (var item in list) {if (item. id> 5) break; client. timeout = 600000; var mail = client. getMailMessage (item. id); Console. writeLine (mail. body );}}
2. Kingthy. Mail. IMAP4
Manage and receive emails Based on the IMAP4 protocol
Example: IMAP4Client client = new IMAP4Client ("imap.gmail.com", 993, "xxx@gmail.com", "xxx", true); client. isDebugMode = true; // enable the debugging mode. After the debug mode is enabled, an "imap4trace" is generated in the directory where the dll library is located. log "file client. connect (); var mailboxes = client. getAllMailboxes (); var mailbox = mailboxes. find (x => x. name. equals ("INBOX", StringComparison. invariantCultureIgnoreCase); var status = mailbox. select (); for (int I = 1; I <= status. totalMessages; I ++) {var mail = mailbox. getMailMessage (I); Console. writeLine (mail. body );}
3. Kingthy. Mail. Mime
Used to parse the MIMI-format email content, such as The. eml file
Example: MailMessage mail = MimeParser. Parse (@ "c: \ mailboxes \ 1.eml"); Console. WriteLine (mail. Body );
Project hosting:
The Kingthy. Mail project is hosted on Google code.
URL: http://kingthy-mail.googlecode.com/
SVN: http://kingthy-mail.googlecode.com/svn/src/