检查未读电子邮件? [英] check unread emails?

查看:107
本文介绍了检查未读电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从邮件服务器获取大量未读邮件,例如gmail,yahoo,msn,aim和用户提供的任何其他电子邮件服务器


但问题是 - 我不知道如何(笑)我试过这个DLL: http://www.lesnikowski.com /mail/faq.aspx 但在它的常见问题解答中它说:

使用POP3协议是不可能的。无法在服务器上标记客户端应用程序收到哪些消息。你必须标记自己已经阅读过哪些消息。


Windows Live Messenger在Messenger中显示未读邮件,我只是想在我自己的应用程序中实现,我不想显示邮件,我只想要未读邮件的数量,请注意 - 我在这个Net的东西新手:),是的它是一个C#窗体




i做了一些研究并且*我不确定*但是IMAP可以读取未读邮件的数量吗?但雅虎,MSN,gmail,aol和其他服务是否支持IMAP?如果是,那我怎么能在我的应用程序中实现IMAP,因为所有的DLL都在那里问钱,我不想花钱.. EAGetMail DLL就像一个魅力,但它的30天试用 - argghhh

i wanna get number of unread mails from mail servers, like gmail, yahoo, msn, aim and any other email server which user gives

but the problem is - i dont know HOW (lol) i tried this DLL: http://www.lesnikowski.com/mail/faq.aspx but in its faq it says this:
That is not possible with POP3 protocol. There is no way to mark on the server which messages were received by client application. You have to mark which messages have been read by yourself.

The Windows Live Messenger shows unread mails in messenger, i just wanna implement in my own app, i dont wanna show the mails, i just want the number of unread mails, please note - i m newbie at this Net stuff :), and yes its a C# windows forms


i did some research and *i m not sure* but IMAP can read the number of unread mails?, but do yahoo, msn, gmail, aol and other services support IMAP? if yes then how can i implement IMAP in my application because all the DLL''s out there ask money and i dont wanna spend money.. EAGetMail DLL works like a charm but its 30 day trial - argghhh

推荐答案

连接到服务器后发送命令:

" list"


服务器然后将重播:

+ OK 1 414

当+ OK状态命令被服务器识别时

1 - 是未读电子邮件的数量

414 - 是电子邮件容量。
After you have a connection to the server send the command:
"list"

the server then will replay:
+OK 1 414
when +OK state the the command is recognized by the server
1 - is the number of unread emails
414 - is the emails capacity.


@liadmz


OMG真棒!但是如何建立与服务器的连接(lol)
@liadmz
OMG AWESOME!! but how to establish connection to the server (lol)


这是我正在研究的一个类。

你需要将它添加到你的项目中创建一个新对象。


MailHandler X =新MailHandler();

MailHandler.zip

使用以下方法设置POP3和SMTP设置:

X.SetSMTP(txtSMTP_server.Text, txtSMTP_user.Text,txtSMTP_pass.Text);

X.SetPOP(txtPOP_server.Text,txtPOP_user.Text,txtPOP_pass.Text);


计算电子邮件数在服务器上使用:

int EmailCount = X.RetrieveMailCount();


希望这个有用。





Here is a class I''m working on.
You need to add it to your project and create a new object.

MailHandler X = new MailHandler();

MailHandler.zip

Set the POP3 and SMTP setting using:
X.SetSMTP(txtSMTP_server.Text, txtSMTP_user.Text, txtSMTP_pass.Text);
X.SetPOP(txtPOP_server.Text, txtPOP_user.Text, txtPOP_pass.Text);

To count the emails on the server use:
int EmailCount = X.RetrieveMailCount();

Hope this one will help.


这篇关于检查未读电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆