Results 1 to 12 of 12

Thread: Receive Email with Smtp?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2009
    Posts
    358

    Receive Email with Smtp?

    I already know how to send emails using smtp with gmail and I need to know how to reveive emails. Can anybody help?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Receive Email with Smtp?

    You don't receive emails with SMTP. SMTP is specifically a protocol for sending email. The most common protocol for receiving email is POP3. Have you ever setup an email client on your own machine? You have to supply an SMTP (Simple Mail Transfer Protocol) server so you can send email to other people and you also have to supply a POP3 (Post Office Protocol) server so you can receive email form other people.

    The .NET Framework provides inbuilt functionality to send email via SMTP because it is a very common thing to want an application to send email for notification purposes, support requests, etc. etc.

    The .NET Framework does NOT provide inbuilt functionality to receive email via POP3 because it is very UNcommon to want an application to receive email. Everyone has an email client to receive and read email so the need for us to write applications to receive email is essentially non-existent. As such, if you really want to write your own app to receive email then you're going to have to either write your own code to implement the POP3 protocol using low-level objects like Sockets, or else buy a component that has already done that for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Re: Receive Email with Smtp?

    Quote Originally Posted by jmcilhinney View Post
    The .NET Framework provides inbuilt functionality to send email via SMTP because it is a very common thing to want an application to send email for notification purposes, support requests, etc. etc.

    What is this called?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Receive Email with Smtp?

    Quote Originally Posted by kiwis View Post
    What is this called?
    To send email in a .NET application you use the System.Net.Mail namespace, specifically the MailMessage and SmtpServer classes. There are lots of examples about.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Member Reva's Avatar
    Join Date
    Sep 2008
    Posts
    60

    Re: Receive Email with Smtp?

    is there an example how to receive that email via sockets programming ?

    i've seen one in C#, but i need a VB2008 code.

    even i could convert that language, but perhaps i can see another code to do the same task.. and of course not wasting my time

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Receive Email with Smtp?

    Quote Originally Posted by Reva View Post
    is there an example how to receive that email via sockets programming ?

    i've seen one in C#, but i need a VB2008 code.

    even i could convert that language, but perhaps i can see another code to do the same task.. and of course not wasting my time
    I've also seen C# code to receive email but never VB code.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Member Reva's Avatar
    Join Date
    Sep 2008
    Posts
    60

    Re: Receive Email with Smtp?

    hey, i've found somebody post here http://www.vbforums.com/showthread.php?t=567365

    in codeproject the author says that the source code include a dll, but i think the dll is in the source code too..

  8. #8
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Receive Email with Smtp?

    Quote Originally Posted by jmcilhinney View Post
    You don't receive emails with SMTP. SMTP is specifically a protocol for sending email. The most common protocol for receiving email is POP3.
    Thats not true. The most common method of receiving emails is through SMTP... Yes you might use POP3 (or IMAP or whatever) from a PC to view the emails but the actual email delivery to the server happens through SMTP. POP3 is simply downloading the emails from a server that has already received the emails. If that was not the case then we wouldnt have to allow port 25 (SMTP port) through all of our firewalls for emails to be able to be delivered to us.

    So I suppose it depends on whether or not the OP wants to just create a program that can view/download messages from a server that has already received the message, or if they want to create an actual server that can accept raw SMTP messages and store them in some kind of mailbox structure.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  9. #9
    Member Reva's Avatar
    Join Date
    Sep 2008
    Posts
    60

    Re: Receive Email with Smtp?

    Quote Originally Posted by chris128 View Post
    Thats not true. The most common method of receiving emails is through SMTP... Yes you might use POP3 (or IMAP or whatever) from a PC to view the emails but the actual email delivery to the server happens through SMTP. POP3 is simply downloading the emails from a server that has already received the emails. If that was not the case then we wouldnt have to allow port 25 (SMTP port) through all of our firewalls for emails to be able to be delivered to us.

    So I suppose it depends on whether or not the OP wants to just create a program that can view/download messages from a server that has already received the message, or if they want to create an actual server that can accept raw SMTP messages and store them in some kind of mailbox structure.
    is that mean, same as make a code for build an email server?

    i think he just want to received email from email server, especially gmail..

    but, is there any sample code to make an email server ?

  10. #10
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    Re: Receive Email with Smtp?

    Quote Originally Posted by chris128 View Post
    Thats not true. The most common method of receiving emails is through SMTP... Yes you might use POP3 (or IMAP or whatever) from a PC to view the emails but the actual email delivery to the server happens through SMTP. POP3 is simply downloading the emails from a server that has already received the emails. If that was not the case then we wouldnt have to allow port 25 (SMTP port) through all of our firewalls for emails to be able to be delivered to us.

    So I suppose it depends on whether or not the OP wants to just create a program that can view/download messages from a server that has already received the message, or if they want to create an actual server that can accept raw SMTP messages and store them in some kind of mailbox structure.

    0 email (CLIENTS) use SMTP to request email.
    it's a protocol intended only for electronic e-mail servers and mail transferring agents.

    E-Mail clients do not receive e-mails with SMTP, they request it from an e-mail server using a request type protocol.

    additionally a quick google search revealed : http://www.a1vbcode.com/snippet-3383.asp
    Last edited by TokersBall_CDXX; Aug 14th, 2009 at 08:32 AM. Reason: URL
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  11. #11
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Receive Email with Smtp?

    I know, thats exactly what I said. If the OP wants to just make a mail client that downloads mails from a server then fine, use POP3 or IMAP. If they want to make something that actually receives email messages from other servers via SMTP (which is what the title of the thread implies to me, but may or may not be what they actually want) then they need to create their own SMTP server.

    So I suppose it depends on whether or not the OP wants to just create a program that can view/download messages from a server that has already received the message, or if they want to create an actual server that can accept raw SMTP messages and store them in some kind of mailbox structure.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  12. #12
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Receive Email with Smtp?

    Quote Originally Posted by Reva View Post
    but, is there any sample code to make an email server ?
    I'm trying to put something together for an example of this (having some problems at the moment though, see http://www.vbforums.com/showthread.php?t=580413). If/when I get it finished I will post a class in the Codebank section of these forums that can be used to host an SMTP server in your application, which you could use to build your own mailbox/email server structure around.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width