0

I am looking for a vb.net code for receiving e-mails without using any 3rd party libraries. I want to check Unread messages, Inbox and Sent messages. A Working sample is appreciated.

What is the default port for SMTP , is it port 25 (is it the same for all SMTP mail servers?). Which is more flexible in my case POP3 or IMAP ?

Edit: Someone please give me a sample working code for receiving mail using lumisoft (pop) in vb.net

SpongeBob SquarePants
  • 1,035
  • 12
  • 26
  • 46
  • 2
    Have a look at this duplicate [Recommendations for a .NET component to access an email inbox](http://stackoverflow.com/questions/18006/recommendations-for-a-net-component-to-access-an-email-inbox) It is for C# not VB.Net, but for this question the important thing is the choice of component, and those components can be used from VB just as easily as from C#. I'm voting to close your question, please don't take that personally. It just means I think your question is a duplicate of that other question. On StackOverflow we like to close duplicate questions to keep things organised. – MarkJ Jan 26 '11 at 15:07
  • No don't close this, I am unable to find a working code anywhere else. – SpongeBob SquarePants Jan 26 '11 at 15:44
  • This is a scrap note for receiving response from mail clients : http://evry1falls.freevar.com/VBNet/VS2010DataBaseBook/vbnetpop3.html really useful. –  Aug 16 '12 at 00:06

2 Answers2

0

Pop is more supported and most servers have it on if you want to implement your own pop service a good place to start is the rfc.

Community
  • 1
  • 1
rerun
  • 25,014
  • 6
  • 48
  • 78
0

From lumisoft Help.

/*
 To make this code to work, you need to import following namespaces:
 using LumiSoft.Net.Mime;
 using LumiSoft.Net.POP3.Client; 
 */

using(POP3_Client c = new POP3_Client()){
    c.Connect("ivx",WellKnownPorts.POP3);
    c.Authenticate("test","test",true);

    // Get first message if there is any
    if(c.Messages.Count > 0){
        // Do your suff

        // Parse message
        Mime m = Mime.Parse(c.Messages[0].MessageToByte());
        string from = m.MainEntity.From;
        string subject = m.MainEntity.Subject;            
        // ... 
    }        
}
Dori
  • 915
  • 1
  • 12
  • 20
Anuraj
  • 18,859
  • 7
  • 53
  • 79