IIS and SMTP - SMTP Error

This is Interesting: Free IT Magazines  
Home > Archive > IIS and SMTP > April 2005 > SMTP Error





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SMTP Error
Jay

2005-04-07, 6:05 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 Cochran

2005-04-08, 5:51 pm

On Thu, 7 Apr 2005 15:10:51 -0400, "Jay" <AreYouKidding@microsoft.com>
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.

>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.

>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

>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.
>
>
>
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com