Groups | Blog | Home
all groups > iis smtp nntp > april 2005 >

iis smtp nntp : SMTP Error


Jay
4/7/2005 3:10:51 PM
I am sending emails using asp.net. See code below. I am using IIS 6.0 and
Windows 3K.

Question 1:
What is the difference between setting the mail server in code
(SmtpMail.SmtpServer = "foo.com") with setting it in IIS as the Smarthost?
Do I need both.

Question 2:
When I execute the code below SmtpMail.Send(eMail) sometimes takes several
seconds to execute. Sometimes it fails.

Why the delay?
What causes this to fail. The Exchange Server is working ok.

Thanks - see code and error below.

Jay

------

Try
SmtpMail.Send(eMail)
Catch ex as Exception
Dim msg1 as String = ex.message
Dim msg1 as String = exInnerException.Message
EventLog.Insert ("SendEmail", msg1 + " InnerException: " + msg2
End Try

EventLog stores error in database.

This is the error I get
Could not access 'CDO.Message' object. InnerException: Exception has been
thrown by the target of an invocation.




jeff.nospam NO[at]SPAM zina.com
4/8/2005 12:00:00 AM
On Thu, 7 Apr 2005 15:10:51 -0400, "Jay" <AreYouKidding@microsoft.com>
[quoted text, click to view]

A smarthost is an SMTP server you want your SMTP to send all mail
through. Normally this is not what you want, and you leave the
smarthost empty.

[quoted text, click to view]

Given the information you provide, there's no way to tell. Maybe the
system is busy. Maybe the connection takes a while to establish
because the other end is busy.

[quoted text, click to view]

This sounds like a coding issue from the code you list, try posting in
a .NET group for help there.

Jeff

[quoted text, click to view]
AddThis Social Bookmark Button