A socket operation was attempted to an unreachable network

M

manual tester

I am new to ASP.NET. I am getting the following errror, when i tried to
run a website that has 'Password Recovey' control in it. I think the
error has something to do with the SMTP mail settings. Can anyone tell
me how to set up email settings for the password recovery control to
work properly.

Thanks,
..NET Developer

============================================

A socket operation was attempted to an unreachable network
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 socket
operation was attempted to an unreachable network

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.


Stack Trace:


[SocketException (0x2743): A socket operation was attempted to an
unreachable network]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +200
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +60
System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception) +579

[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) +391
System.Net.PooledStream.Activate(Object owningObject, Boolean async,
Int32 timeout, GeneralAsyncDelegate asyncCallback) +288
System.Net.PooledStream.Activate(Object owningObject,
GeneralAsyncDelegate asyncCallback) +46
System.Net.ConnectionPool.GetConnection(Object owningObject,
GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +429
System.Net.Mail.SmtpConnection.GetConnection(String host, Int32
port) +333
System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
+287
System.Net.Mail.SmtpClient.GetConnection() +56
System.Net.Mail.SmtpClient.Send(MailMessage message) +1679

[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +2246
System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email,
String userName, String password, MailDefinition mailDefinition, String
defaultSubject, String defaultBody, OnSendingMailDelegate
onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate,
Control owner) +482

System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordQuestionView()
+743
System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword()
+106
System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object
source, EventArgs e) +136
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args) +56
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +178

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+72
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3838
 
P

Peter Johnson

Could you post the code that sends the email out?

It is possible you haven't specified the mail server correctly? or not
set it at all?

Without seeing the code we can only guess.

Regards,

Pete
 
M

manual tester

The problem is fixed now. I had not set the profile settings in the
web.config file, which caused the error.
Thanks for your reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top