Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > The transport failed to connect - Error Handling - TRY/CATCH

Reply
Thread Tools

The transport failed to connect - Error Handling - TRY/CATCH

 
 
jason@cyberpine.com
Guest
Posts: n/a
 
      02-02-2004
I discovered this morning that a few of my sites have routines to
automatically email when pages are accessed. These pages were down
becuase the the smtp server I'm using was down. I would see a delay to
load the page for about 10 seconds followed by the :

The transport failed to connect error.

using the following code to email:

SmtpMail.Send(mail)

I added a try/catch, but now I still see the 10 second delay and
finally the page loads.

Try
SmtpMail.Send(mail)
Catch Exc As Exception
Finally
End Try

Question, Any way I can code the try/catch to give up much quicker on
the attempt to email.
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      02-02-2004
Rather than giving up quicker, you might want to send the emails using an
asynchronous thread. This way the program execution wil not stop while the
emails are being sent.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> I discovered this morning that a few of my sites have routines to
> automatically email when pages are accessed. These pages were down
> becuase the the smtp server I'm using was down. I would see a delay to
> load the page for about 10 seconds followed by the :
>
> The transport failed to connect error.
>
> using the following code to email:
>
> SmtpMail.Send(mail)
>
> I added a try/catch, but now I still see the 10 second delay and
> finally the page loads.
>
> Try
> SmtpMail.Send(mail)
> Catch Exc As Exception
> Finally
> End Try
>
> Question, Any way I can code the try/catch to give up much quicker on
> the attempt to email.



 
Reply With Quote
 
 
 
 
jason@cyberpine.com
Guest
Posts: n/a
 
      02-03-2004
"Kevin Spencer" <(E-Mail Removed)> wrote in message news:<uJE$(E-Mail Removed)>...
you might want to send the emails using an asynchronous thread.

sounds good. I coded the following , but it does not seem to execute
the sub. I found plenty of CS examples on threads in this group, but
none in VB.NET under ASP.NET. Looking for something quick and dirty,
if the thread dies, don't care to message anything, just continue
serving pages.


Sub Page_Load(Src as object, E as EventArgs )
Try
Dim t As New thread(Addressof eout)
t.start()
response.write("<br>trying")
Catch ex As exception
response.write("<br>failed")
End Try
end sub

Sub eout()
... email code that works by itself when smtp server is up
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intermittent "The transport failed to connect to the server" error Hawksey ASP .Net 1 11-06-2009 10:11 AM
ASP.NET mail error: The transport failed to connect to the server James Lankford ASP .Net 14 07-16-2008 02:24 PM
Error: The transport failed to connect to the server Nathan Sokalski ASP .Net 5 12-11-2006 07:32 PM
want to replace a read only cd transport with read / write transport larya Computer Support 7 09-11-2006 10:21 PM
CDO Question: transport failed to connect to the server Lori McDonald ASP .Net 0 02-16-2004 08:09 PM



Advertisments