none
C# email client RRS feed

  • Question

  • i want to design a wiindows application in c#.net. by using this application i want to recive the mail on my computer and want to save this mails in any text file ( this work like MS Outlook), till now i designed sending emails from this application, but in receving i face problem , what is its API or pop Server for reciving the mail from email inbox and how it is we can use in coding. Can someone help me in this work

     

    Thursday, September 2, 2010 12:48 PM

Answers

  • Hi JaswinderChauhan,

     

    Welcome to MSDN Forum!

     

    There’s an article will show you the process on receiving emails from a POP3 server.

     

    POP3 Email Client

    The present first article focuses on the downloading of raw emails from a POP3 server (RFC1939). There are methods to connect to a POP3 server, to get a list of available emails, to request some emails, to delete some emails and to disconnect. For debugging and for professional use, extensive error reporting and communication tracing is provided.

     

    In the connected (POP3: transaction) state, the client can execute the following commands:

    • STAT: GetMailboxStats(), number of mails and size of mailbox
    • LIST: GetEmailIdList(), a list with session message numbers and size for all emails
    • LIST [msg]: GetEmailSize(), session message number and size for just one email
    • UIDL: GetUniqueEmailIdList(), a list with unique ID numbers and session message numbers for all emails
    • NOOP: NOOP(), No operation, just check if server is still alive
    • RETR msg: GetRawEmail(), retrieve one complete email
    • DELE msg: DeleteEmail(), Mark one email for deletion once the connection is properly closed
    • RSET: UndeleteAllEmails(), POP3 server deletes unmarks the emails marked for deletion
    • QUIT: Disconnect(), POP3 server deletes emails as needed and closes TCP connection

     

    There’s also exist a demo for help you to understand this process.

    To get the demo code running, you need to enter your own credentials for username and password in the following line:

            // TODO: Replace username and password with your own credentials.
            Pop3.Pop3MailClient DemoClient = new Pop3.Pop3MailClient("pop.gmail.com", 995, true"Username@gmail.com""password");

     

     

    Have a nice day!

    Mike

    -------------------------------------------------------------------

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.

     

    =================================================

    Third party disclaimer

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information is found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Tuesday, September 7, 2010 3:33 AM
    Moderator

All replies

  • I assume you have an exchange server as mailserver, then you query it using a language called webdav, it is sort of like sql, but in xml format.

    I googled and found a hit that explains, although the code was VB

    http://msdn.microsoft.com/en-us/library/aa123571(EXCHG.65).aspx

    Thursday, September 2, 2010 12:54 PM
  • Receiving Mail requires Request to a Mail Server,

    If you want to check Gmail, Yahoo etc mails

    Read about  POP settings (Port, Server Name, TLS Security) of Yahoo

    and IMAP Settings (Port, Server Name, TLS Security) of Gmail


    .NET Maniac -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Thursday, September 2, 2010 1:16 PM
  • Hi JaswinderChauhan,

     

    Welcome to MSDN Forum!

     

    There’s an article will show you the process on receiving emails from a POP3 server.

     

    POP3 Email Client

    The present first article focuses on the downloading of raw emails from a POP3 server (RFC1939). There are methods to connect to a POP3 server, to get a list of available emails, to request some emails, to delete some emails and to disconnect. For debugging and for professional use, extensive error reporting and communication tracing is provided.

     

    In the connected (POP3: transaction) state, the client can execute the following commands:

    • STAT: GetMailboxStats(), number of mails and size of mailbox
    • LIST: GetEmailIdList(), a list with session message numbers and size for all emails
    • LIST [msg]: GetEmailSize(), session message number and size for just one email
    • UIDL: GetUniqueEmailIdList(), a list with unique ID numbers and session message numbers for all emails
    • NOOP: NOOP(), No operation, just check if server is still alive
    • RETR msg: GetRawEmail(), retrieve one complete email
    • DELE msg: DeleteEmail(), Mark one email for deletion once the connection is properly closed
    • RSET: UndeleteAllEmails(), POP3 server deletes unmarks the emails marked for deletion
    • QUIT: Disconnect(), POP3 server deletes emails as needed and closes TCP connection

     

    There’s also exist a demo for help you to understand this process.

    To get the demo code running, you need to enter your own credentials for username and password in the following line:

            // TODO: Replace username and password with your own credentials.
            Pop3.Pop3MailClient DemoClient = new Pop3.Pop3MailClient("pop.gmail.com", 995, true"Username@gmail.com""password");

     

     

    Have a nice day!

    Mike

    -------------------------------------------------------------------

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.

     

    =================================================

    Third party disclaimer

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information is found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Tuesday, September 7, 2010 3:33 AM
    Moderator