How to receive a mail in Windows application [duplicate]
Possible Duplicate:
Recommendations for a .NET component to access an email inbox
I know how to send emails in .Net but:
- how to开发者_开发问答 receive an email in my Windows forms?
- how to read emails?
For receiving email, see this POP3 example.
Take a look at this example of SMTP Client for sending.
You should use a library for it. I'm using following:
http://www.codeproject.com/KB/IP/Pop3MimeClient.aspx
There is a difference between receiving email, and retrieving email. Which one do you want?
If you want to receive email, that mean you need to set up a socket listener, and listing for SMTP commands. Basically, you have to build your own SMTP server to accept email.
The other way, is to retrieve email, which means you want to use the POP3 or IMAP4 protocol to fetch emails. This depends upon the server you are connecting to, to download the emails. If you want to go this route, then you may want to google for C# and POP3 (or IMAP4).
If you already have the content of the emails, and you simply need to read them, then you need a Mime parsing library.
精彩评论