Open-source Kingthy. Mail Component Library

Source: Internet
Author: User

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/

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.