SMTP Error
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS and SMTP > SMTP Error




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SMTP Error  
Jay


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-07-05 11: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.










[ Post a follow-up to this message ]



    Re: SMTP Error  
Jeff Cochran


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-08-05 10: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.
>
>
>
>






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:04 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register