As long as the following conditions are met, you should be able to send mail thru a mail server using the .Net mail classes:
A. You can access the server via an IP connection (inside a network or outside)
B. The mail server does not require authentication to drop mail onto it. (This is most likely the cause of problems.)
C. The mail server is running (You never know! ;))
Whether or not mail dropped onto a valid SMTP server will get OUT is a different issue. In the case of the IIS SMTP server, I believe it makes the connection to the appropriate mail server itself. It shouldn't even need to know about another mail server to get the mail out (i.e. it doesn't need to talk to your company's public mail server.)
One thing to note regarding sending mail. Let's say my company's mail server is mail.mycompany.com. If I use the .Net mail classes to send mail, the mailmessage class talks directly to that server and I'm trying to send mail to "
[email protected]", I have to ensure that there is actually an account for "someaddress" on that mail server. You'll get an immediate failure when you try to create the message on the SMTP when that SMTP is on the same mail system as the POP server that will eventually handle any recipient's address. Hope that makes sense. However, when you use "localhost" (IIS SMTP on the web server) you shouldn't have a problem. If the email address is bad, the message will just bounce and probably end up in the bit bucket unless you used a real "from" address.
The authentication issue may be a discussion to have with the mail server administrator. In most LAN configuration's I've seen, the SMTP service is set up so that anyone who's on the local network can drop mail. From the outside (public IP addresses) only users who have authenticated into POP can drop mail. I think the server recognizes the user's IP address and allows mail relay from that address for some predetermined amount of time. Additionally, the SMTP service (if capable) can be set up to require authentication to send mail. Typically, allowing accessive security from the outside is acceptable, but usually that much security from inside the LAN is not necessary. IMO, if the mail server administrator is that worried/paranoid about someone unauthorized accessing the mail server from the LAN s/he should be more worried about how they got into the LAN in the first place!
There's my dissertation on accessing mail servers. :)
Peter