views:

292

answers:

2
  1. I assume that web controls (such as the PasswordRecovery control) use SmtpClient to send email messages. If so, does SmtpClient represent a POP3 client or does SmtpClient forward email message to POP3 client?

  2. Do attributes specified inside <smtp> element in web.config map to SmtpClient class?

    <system.net>
      <mailSettings>
        <smtp deliveryMethod="Network" ...></smtp>
      </mailSettings>   
    </system.net>
    
  3. One of the possible values for the attribute deliveryMethod is Network, which tells that email should be sent through the network to an SMTP server. In other words, this value tells to send email to SMTP server using SMTP protocol?!

  4. For the PasswordRecovery control to be able to send email messages, we need to set basic properties in <MailDefinition> subelement of the PasswordRecovery control. Thus I assume MailDefinition is used by controls to create an email message?!

thanx

+3  A: 

SmtpClient speaks SMTP!

Email servers receive via SMTP and you retrieve data via POP3 or other protocol.

Two clients will NEVER talk to each other. One client will send to the server. The message will be forwarded from one server to another until it reaches the one where the recipient's email account is registered. Finally the client will connect to that server and retrieve the e-mail.

Brad Bruce
BRAD BRUCE - "SmtpClient speaks SMTP!"So does POP3 client when forwarding message ( to be sent ) to SMTP server
SourceC
What library are you using? The .Net framework doesn't have a Pop3Client class, that I've been able to find.
Brad Bruce
+2  A: 

The SmtpClient class represents (as the name suggests) an smtp client, not a POP3 client. The SmtpClient class uses the smtp configuration section to pick up default values for its operation.

Your interpretation of the NetworkDelivery value is correct. The other delivery methods make use of pickup directories (which actually is a rather nice approach; it disconnects the code from needing the SMTP server to be up and running when the mail message is posted).

For further details on the SmtpClient class, I would suggest to dive into the documentation of it.

And yes, the MailDefinition is used internally in the PasswordRecovery control to create the mail message.

Fredrik Mörk
Yeah, it's amazing how much useful info MSDN has that people simply neglect!
Noldorin
Reason for my confusion is that POP3 client (also used to download email from SMTP server using POP3 protocol ) also forwards email message to SMTP server using SMTP protocol, just like SmtpClient class does. So is SmtpClient then used instead of POP3 client to forward a message to SMTP server, or is POP3 client also used at some point?
SourceC
You do not download email from an SMTP server. The smtp server may run on the same machine as the pop3, it may even be in the same executable program, but it may just as well be a software completely separate from the pop3 server running in the same machine, and they will be listening to different ports. Smtp is used for sending mail, pop3 for fetching mail. When your mail client sends a message, it is not a pop3 client, it is an smtp client.
Fredrik Mörk
Makes sense now. What confused me was an excerpt I read from Mastering Windows server 2000, where author writes that POP3 client also sends messages (to SMTP server) using SMTP protocol. Thus I assumed we also reffer to a program (sending messages to SMTP server) as POP3 client. Thank you for helping me
SourceC