Home » Source Code » 处理POP3/IMAP4协议的邮件接收与MIME格式邮件内容的解析

处理POP3/IMAP4协议的邮件接收与MIME格式邮件内容的解析

nikolai
2016-05-19 19:37:25
The author
View(s):
Download(s): 1
Point (s): 1 
Category Category:
AllAll

Description

Kingthy.Mail.POP3

根据POP3协议进行邮件接收. ``` 例子: POP3Client client = new POP3Client("pop.gmail.com", 995, "xx@gmail.com", "xx", true); client.IsDebugMode = true; 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); } }

```

Kingthy.Mail.IMAP4

根据IMAP4协议对邮箱进行管理和接收邮件 ``` 例子: IMAP4Client client = new IMAP4Client("imap.gmail.com", 993, "xxx@gmail.com", "xxx", true); client.IsDebugMode = true; 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);
        }

```

Kingthy.Mail.Mime

用于解析MIMI格式的邮件内容,如.eml文件 例子: MailMessage mail = MimeParser.Parse(@"c:\mailboxes\1.eml"); Console.WriteLine(mail.Body);

Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
Kingthy.Mail.dll36.00 kB2010-03-23|17:14
Kingthy.Mail.xml50.18 kB2010-03-23|17:14
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
  • 1
  • Page 1
  • Total 1

处理POP3/IMAP4协议的邮件接收与MIME格式邮件内容的解析 (21.39 kB)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D