System.Web.Mail.SmtpMail.Send()

  • Thread starter Thread starter Mike Labosh
  • Start date Start date
M

Mike Labosh

I have noticed that this thing can correctly send mail even if the SmtpMail
property has not been initialized.

In absence of this property setting, is it querying DNS for an MX record?
 
My guess is it would try to use the local machine as an SMTP gateway.

There is no SMTP service running on the local machine. Without setting the
SmtpServer property, it "shouldn't" know what server to send the message to.
That's why I was wondering if it did a DNS lookup for MX records.
 
You could use NetMon to see for sure. My guess would be it may be grabing
server from outlook or something.
 
Did a little more digging on MSDN and found out that
System.Web.Mail.SmtpMail uses CDO, so if you don't set SmtpServer it's
queued on the system & uses the local SMTP service.

"If the SmtpServer Property is not set, mail is by default queued on a
Windows 2000 system, ensuring that the calling program does not block
network traffic. "

So...if you're positive that SMTP isn't installed or running in any way on
your server (not even the default SMTP that gets installed with IIS), then
I'm not sure how it could be sending out the emails.
 
It stores it on the local machine. You probably have the SMTP service
installed.. it does not need to be running . .NET will queue the item...
when you start the SMTP service the mail will be sent (subject to the relay
settings of the SMTP service of course)
 
Back
Top