On Thu, 7 Apr 2005 15:10:51 -0400, "Jay" <AreYouKidding@microsoft.com>
[quoted text, click to view] wrote:
>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.
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] >Question 2:
>When I execute the code below SmtpMail.Send(eMail) sometimes takes several
>seconds to execute. Sometimes it fails.
>
>Why the delay?
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] >What causes this to fail. The Exchange Server is working ok.
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] >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.
>
>
>
>