473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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.
Nov 18 '05 #1
2 2191
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.

<ja***@cyberpine.com> wrote in message
news:ef*************************@posting.google.co 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.

Nov 18 '05 #2
"Kevin Spencer" <ke***@takempis.com> wrote in message news:<uJ**************@TK2MSFTNGP11.phx.gbl>...
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
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mo | last post by:
The code I've pasted below is taken directly from Microsoft's site at http://support.microsoft.com/default.aspx?scid=kb;EN-US;308157 As far as I can tell the error is raised on this line: conn...
12
by: James Lankford | last post by:
Hello group: I have reached the end of my rope with this error. I have pretty much tried every suggestion I've found thus far and I get this error no matter what I do. I did try using the CDOSYS...
0
by: Lori McDonald | last post by:
I have code that I am using to sent an HTML email. (see code below) Intermittently I am getting the following error when I try and send an email message from ASP.Net code on my server. 80% of the...
0
by: Hawksey | last post by:
Hello, Has anyone else experienced a similar problem. We get an intermittent error trying to send mail using smtpmail. Our SmtpMail.SmtpServer is a different server to our web application...
5
by: Nathan Sokalski | last post by:
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send() method. My code contains all of the following: Dim mailmsg As New Mail.MailMessage Mail.SmtpMail.SmtpServer =...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
0
by: wizromeo | last post by:
Hello, Has anyone else experienced a similar problem. We get an intermittent error trying to send mail using smtpmail. Our SmtpMail.SmtpServer is a different server to our web application...
0
by: daredevil | last post by:
hi all, i am newbie here. i was trying to send mail from ASP, but i encountered the error as below:- CDO.Message.1 (0x80040213) The transport failed to connect to the server. i already google...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.