A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

please can you help, when i do my request form i am getting an error. this happens when it is called over the web externally when i launch in visual stuido it works fine, i am local to the smtp server. it is an Exchange 2003 server. It has an address published, i can connect to port 25 with telnet to the dnsname.

 

I have many different snippets of code i have tried in a bid to get to the root, i think it cant authenticate. i have assigned 3 buttons to different subs for the mail send, noe of which work

 

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 217.41.13.159:25

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 217.41.13.159:25

Source Error:

Line 39:         Dim MailToken As String = My.User.Name
Line 40: 
Line 41:         client.Send(msg)
Line 42: 
Line 43:     End Sub

Source File: c:\inetpub\wwwroot\TDBatHOME\RequestInfo.aspx.vb    Line: 41

Stack Trace:

[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 217.41.13.159:25]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1073657
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +217

[WebException: Unable to connect to the remote server]
   System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +1490784
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +191
   System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +318
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +227
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316
   System.Net.Mail.SmtpClient.GetConnection() +42
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1485

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +2074
   RequestInfo.SendMail(String from, String body) in c:\inetpub\wwwroot\TDBatHOME\RequestInfo.aspx.vb:41
   RequestInfo.Button3_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\TDBatHOME\RequestInfo.aspx.vb:7
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

 

 

Here is the code i have tried.

 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim mailmessage As New MailMessage("website@tdbconsulting.co.uk", "si.purr@tdbathome.co.uk")

mailmessage.Subject = "New Message from TDB at Home Website"

mailmessage.Body = "Full Name: " & txtNAME.Text & "<br>" & "Address: " & txtADD1.Text & "<br>" & txtADD2.Text & "<br>" & txtTOWN.Text & "<br>" & txtCOUNTY.Text & "<br>" & txtPOSTCODE.Text & "<br>" & "Number: " & txtNUMBER.Text & "<br>" & "Email: " & txtEMAIL.Text

mailmessage.IsBodyHtml = True

Dim smtp As New SmtpClient

smtp.Host = "192.168.0.2" 'local address

smtp.Send(mailmessage)

End Sub

then this is the next

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

 

SendMail(txtEMAIL.Text, table1)

 

 

End Sub

Private Sub SendMail(ByVal from As String, ByVal body As Object)

Dim mailServerName As String = "tdbathome.co.uk"

'create the mail message

Dim mail As New MailMessage()

'set the addresses

mail.From = New MailAddress(txtEMAIL.Text)

mail.To.Add("si.purr@tdbathome.co.uk")

'set the content

mail.Subject = "This is an email"

mail.IsBodyHtml = True

mail.Body = "Full Name: " & txtNAME.Text & "<br>" & "Address: " & txtADD1.Text & "<br>" & txtADD2.Text & "<br>" & txtTOWN.Text & "<br>" & txtCOUNTY.Text & "<br>" & txtPOSTCODE.Text & "<br>" & "Number: " & txtNUMBER.Text & "<br>" & "Email: " & txtEMAIL.Text

'send the message

Dim mailClient As SmtpClient = New SmtpClient

mailClient.Host = mailServerName

mailClient.Send(mail)

mail.Dispose()

End Sub

this also

 

Private Sub SendMail(ByVal from As String, ByVal body As String)Dim msg As New System.Net.Mail.MailMessage("si.purr@tdbathome.co.uk", "si.purr@tdbathome.co.uk")

 

 

' Set message attributes

msg.Subject = " Having a good day?"

msg.Body = "I hope so."

msg.Priority = Net.Mail.MailPriority.High

msg.IsBodyHtml =
False

 

 

Dim client As New System.Net.Mail.SmtpClient("tdbathome.co.uk")Dim creds As New System.Net.NetworkCredential("tdbgroup\myaccount", "mypassword")

 

 

client.Credentials = creds

 

 

'send

Dim MailToken As String = My.User.Name

client.Send(msg)

End Sub

 

i have seent that you can put in the web.config file details to connect to an smtp server, but not sure how this is used.

 

please can someone help..

 

Regards

0
Simon
1/26/2008 2:08:35 PM
asp.net.integration 1945 articles. 0 followers. Follow

3 Replies
1500 Views

Similar Articles

[PageSpeed] 16

Hi, 

Simon Purr:
Line 39:         Dim MailToken As String = My.User.Name
Line 40: 
Line 41:         client.Send(msg)
Line 42: 
Line 43:     End Sub

This appears to be connection issue. Try using the TELNET command with a "25" after the host ID or IP address to test it.


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
0
Zhao
1/29/2008 11:14:42 AM

Yeah it was a connection issue, but the problem was the DNS name resolution. When it was resolving the DNS name. With the server being internal, it cant resolve its own external DNS name. An ammend in DNS adding a host record for www in the the dns zone sorted the problem. was also sorted by using the internal ip of the web server.

0
Simon
1/29/2008 2:12:00 PM

Hi Simon,

Great, here are some general troubleshooting steps for such kind of issue from our Knowledge Base:

http://support.microsoft.com/kb/115492/en-us


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
0
Zhao
1/30/2008 1:29:10 AM
Reply:

Similar Artilces:

"A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond IP:PORT"
 Hi all, "A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond IP:Port"  this is the error i am geeting while sending an email using System.Net.Mail My Code here :MailMessage objMail;        SmtpClient objSMTP;        // Now create the email        objMail = new MailMessage();        objMail.To.Add...

VS2005 IDE: Add Web Refernece. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has fa
 I have published a web service, but cannot connect to it in VS2005.  The Web Methods display, but I then get this error:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond I CAN connect to it outside of VS2005 from IE, Stylus Studio, etc.  /Bob C in GRR Hi  Bob, That might be a problem with proxy. Please try this solution: http://west-wind.com/weblog/posts/3871.aspx. Also you can refer to this article: http://msdn.microsoft...

A connection attempt failed because the connected party did not properly respond after a period of time
 When trying to send an email I'm getting this error. What does it mean? Thanks.A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 216.34.131.135:25 Regards, Curt It means that a connection could not be established to the host at 216.34.131.135 on port 25 I have tried to connect to that host, and it is not accepting mail on port 25 The simple way to test this is go to the command prompt and type: telnet 216.34.131.135 25 this will try and ...

Connection Failed Activation of Network Connection Failed
I am running openSUSE 12.1 Beta 1 GNOME and I cannot get an internet connection. The wireless on my laptop says missing firmware which is fine. It says this on any distro and I can get it working. However, I can not get my wired connection to work. It keeps trying to connect and says "Connection Failed Activation of Network Connection Failed. I have seen other people have this problem online somewhere and they said they had to swap something from manual to auto, but I am not sure what or where. I know that this laptops ethernet card will work fine on here b/c I used ope...

SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has be
Hello, I have a sql 2005 server, and I am a developer, with the database on my own machine.  It alwayws works for me but after some minutes the other developer cant work in the application He got this error Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 192.168.1.140] and When I see the log event after that error, it comes with another error. SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 192.168.1.140] He has IIS5 and me too. ...

superreview granted: [Bug 219376] Trying to resolve IP's via DNS (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail
Brian Ryner <bryner@brianryner.com> has granted Darin Fisher <darin@meer.net>'s request for superreview: Bug 219376: Trying to resolve IP's via DNS (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail) http://bugzilla.mozilla.org/show_bug.cgi?id=219376 Attachment 132718: v1.1 patch http://bugzilla.mozilla.org/attachment.cgi?id=132718&action=edit ...

not connected when I am connected
What do I need to change on my 'puter when the icon in the toolbar shows and tells me I am connected and the error message tells me I am not and I can not go to web pages, get or send emails. I have to close down and restart to get connected again. This only happens if I am on line and leave the 'puter for an hour or so. As long as I am using it I don't have a problem. This just started about a month ago. I am on very slow dialup, DSL and Cable not in my area, thanks you SBC/ATT tks Elaine wrote: > What do I need to change on my 'puter when the icon in ...

Failed to Connect Firefox can't establish a connection
Hello, I get "Failed to Connect Firefox can't establish a connection to the server at 127.0.0.1:3580." when I try to open a Help File of one of the applications I have. My /etc/hosts file has its entries right: 127.0.0.1 hostname.hostdomain hostname My firewall is also disabled. nmap -sT -O localhost gives me (I have included some): 2401/tcp open cvspserver 2601/tcp open zebra 5900/tcp open vnc 8009/tcp open ajp13 8085/tcp open unknown Device type: general purpose Running: Linux 2.6.X OS details: Linux 2.6.17 - 2.6.25 I understand that the port ...

database connection failed with connection cache
I have a connection cache on jag 3.6.1 using com.sybase.jdbc2.jdbc.sybdrives. I am able to ping the connection in jag manager. My problem is in PowerJ 3.6.1. I setup a transaction object using the database wizard(very cool), change it to use a cache and even find the connection cache on the server. when I try to test the connection, I first select a profile jconnect5 and try the connection. I get this error: database connection failed jz006: cought a IoException java.net.connectionException connection refused, no further info. any ideas would be great! You can only...

Connection established
Huge problem at the moment: I am connected to the internet via Wifi (NetworkManager) - and Konqueror tells me I am ONLINE in our local library. They run an open network and users need to log in on a special website to get full internet access. As stated, my computer tells me I would be online, but I don�t have any connection (neither via FF, nor via Konqueror). Same applies when connected via Ethernet. Oh, and I�ve already tried to use and change settings with traditional method with ifup... Strange: In my own villa everything works perfect. * ANY HELP IS VERY MUCH APPRECTIATED. ...

Web resources about - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond - asp.net.integration

Category:Awards established in 1970 - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

FiftyThree, Developer Of Established Paper App, Urges Facebook To Change Name Of Its New App
... York-based startup FiftyThree posted a statement on its website urging Facebook to change the app’s name, since it launched its own, well-established ...

Friends of Mike Patterson Trust Established - Facebook
Friends Of Mike Patterson hat eine Notiz mit dem Titel Friends of Mike Patterson Trust Established geschrieben. Du kannst den vollständigen Text ...

Which Established Facebook Platform Apps Are Spreading Most Quickly Today?
On the first official day of Q3 2009, which established apps are still growing the most quickly? Here are the numbers from AppData on today’s ...

Beats by Dre: "Re-Established 2014” Trailer - YouTube
Beats by Dre debuts “Re-Established 2014.” See the place that made LeBron James. "I mean everything to this city and this city means everything ...

Judicial watchdog established despite concerns from Bar Association
A new judicial watchdog has been established to hold judges and magistrates accountable for minor offences and to respond to complaints from ...

Renewable energy target slashed, wind farm commissioner to be established
A bipartisan deal - agreed to last month after a lengthy political stalemate that hamstrung the clean energy sector - will slash the renewable ...

Sydney siege: Foundation established in memory of victim Katrina Dawson
The family of Sydney siege victim Katrina Dawson has established a foundation in her memory, and have also made plans for a memorial service ...

Good life flows from established vineyard
A boutique winery and residence is on the market, and will appeal to discerning wine lovers.

Newly established Men's Shed robbed, trashed - The Courier
SEBASTOPOL Men’s Shed members feel violated after their facility was broken into and valuable items were stolen.

Resources last updated: 2/11/2016 5:34:51 PM