Showing posts with label webserver. Show all posts
Showing posts with label webserver. Show all posts

Saturday, March 24, 2012

System.Net.Mail.SmtpException

My webserver does not have smtp on it but I'm still able to relay email to my email server with user name and password, my first question is that the dotnet is using an API that's built into server to relay?

Also email stopped working a day ago with error messageSyntax error, command unrecognized. The server response was: 5.1.0 Dropping connection due to an error on this server . Could this error be caused by the internal process dotnet uses to relay not working?

The 5.1.0 error is usually on the remote SMTP server and the error is propogated back to you. Does the server you relay to allow relays?

You're not relaying. System.Net.Mail simply sends the message to the defined SMTP server. Your error is a SMTP error, check the logs on the SMTP server to see what is happening, if you can. A 5.1.0 is a Sender Denied error, which most likely means you now need to use authentication. Checkwww.systemnetmail.com for help and samples.

Jeff


Still not getting this working getting, any help would be appreciated.

System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

Line 88: try
Line 89: {
Line 90: client.Send(message);
Line 91: Response.Redirect("RequestAccepted.aspx");
Line 92: }
Source File:d:\Inetpub\KPClient\ContactUS.aspx.cs Line:90

Stack Trace:

[SocketException (0x274d): No connection could be made because the target machine actively refused it] System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1001874 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) +431[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) +1447464 System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +190 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


This turned out to be a bad router change that was not documented.

System.Net.Sockets.SocketException+webservice+Sourabh Das

Hi,
I have placed a webservice in the webserver. When I access it from a webpage, default.aspx on a click of a button i get the following error:

No connection could be made because the target machine actively refused it
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: No connection could be made because the target machine actively refused it

Source Error:

Line 91: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/getProducts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 92: public System.Data.DataSet getProducts(int productid) {
Line 93: object[] results = this.Invoke("getProducts", new object[] {
Line 94: productid});
Line 95: return ((System.Data.DataSet)(results[0]));


Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6dcecb27\a382a372\App_WebReferences.lgdo8f58.0.cs Line: 93

Stack Trace:

[SocketException (0x274d): No connection could be made because the target machine actively refused it]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002082
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) +431

[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetRequestStream() +1504461
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
localhost.ProductsService.getProducts(Int32 productid) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6dcecb27\a382a372\App_WebReferences.lgdo8f58.0.cs:93
_Default.btnCategory_Click(Object sender, EventArgs e) in D:\users\Padmajamvl\arete\www\Default.aspx.vb:40
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) +5102

------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

Please tell me what is the error. Its urgent.
Regards."Unable to connect to the remote server"
This means, you must update the web reference to access the web service (Rebuild the WSDL file automatically)
Or the server doesn't allow access to the web service folder (not marked as a web application on IIS)

System.Net.Webexecption on WebRequest.GetResponse

Hi Everybody,
after a while, ive had to maintain a ASP.NET/C# project, where
during processing of an request, the same (local!) webserver is
requested again for the response of a corresponding aspx-page.
Something like this:
...
string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
WebRequest req = WebRequest.Create( uri );
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();
Stream st = req.GetResponseStream;
...
This worked fine on my machine a few month ago, as well as on my
collegues machine and alos at the customer.
On all 3 machines, the local IIS instance is responsible to process
the aspx-Request (two XP-SP2, one W2k-Server).
Acutally, when i perform this again, ill get a
System.Net.Webexecption
on the execution of "req.GetResponse()" with following error-stack
System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
System.Net.HttpWebRequest.CheckFinalStatus()
myModule.myMethod()
etc. ...
This error appears also, when i replace the uri above f.e. with
'http://www.google.com'.
Even when i run a downloaded, ready-to-use C#-sample (EXE, not
ASP.NET!),
ill get this error.
On my collegues machine, the same things still works fine, even on the
customers
server, but im not able to test/debug this one on my machine anymore.
I dont know, what could be the reason for it.
My XPs configuration seems very identical to my collegues one.
Also my XP Servicepacks, Patches and .NET-Version look identical to
my
collegue ones.
But there must be a difference!
Does anyone has any idea, that maybe can keep me away from a complete
reinstallation of my machine?
Thanks in advance,
ThomasThis exception is also thrown if the statuscode is 404 for example. Have a
look at this:
<http://msdn.microsoft.com/library/d...o
pic.asp>
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"Thomas Geisel" <tgeisel@.symax.de> wrote in message
news:b455c2e.0501180203.cba6e16@.posting.google.com...
> Hi Everybody,
> after a while, ive had to maintain a ASP.NET/C# project, where
> during processing of an request, the same (local!) webserver is
> requested again for the response of a corresponding aspx-page.
> Something like this:
> ...
> string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
> WebRequest req = WebRequest.Create( uri );
> req.Credentials = CredentialCache.DefaultCredentials;
> WebResponse resp = req.GetResponse();
> Stream st = req.GetResponseStream;
> ...
> This worked fine on my machine a few month ago, as well as on my
> collegues machine and alos at the customer.
> On all 3 machines, the local IIS instance is responsible to process
> the aspx-Request (two XP-SP2, one W2k-Server).
> Acutally, when i perform this again, ill get a
> System.Net.Webexecption
> on the execution of "req.GetResponse()" with following error-stack
> System.Net.HttpWebRequest.CheckFinalStatus()
> System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> System.Net.HttpWebRequest.CheckFinalStatus()
> myModule.myMethod()
> etc. ...
> This error appears also, when i replace the uri above f.e. with
> 'http://www.google.com'.
> Even when i run a downloaded, ready-to-use C#-sample (EXE, not
> ASP.NET!),
> ill get this error.
> On my collegues machine, the same things still works fine, even on the
> customers
> server, but im not able to test/debug this one on my machine anymore.
> I dont know, what could be the reason for it.
> My XPs configuration seems very identical to my collegues one.
> Also my XP Servicepacks, Patches and .NET-Version look identical to
> my
> collegue ones.
> But there must be a difference!
> Does anyone has any idea, that maybe can keep me away from a complete
> reinstallation of my machine?
> Thanks in advance,
> Thomas

System.Net.Webexecption on WebRequest.GetResponse

Hi Everybody,

after a while, ive had to maintain a ASP.NET/C# project, where
during processing of an request, the same (local!) webserver is
requested again for the response of a corresponding aspx-page.

Something like this:

...
string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
WebRequest req = WebRequest.Create( uri );
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();
Stream st = req.GetResponseStream;
...

This worked fine on my machine a few month ago, as well as on my
collegues machine and alos at the customer.
On all 3 machines, the local IIS instance is responsible to process
the aspx-Request (two XP-SP2, one W2k-Server).

Acutally, when i perform this again, ill get a
System.Net.Webexecption
on the execution of "req.GetResponse()" with following error-stack

System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
System.Net.HttpWebRequest.CheckFinalStatus()
myModule.myMethod()
etc. ...

This error appears also, when i replace the uri above f.e. with
'http://www.google.com'.
Even when i run a downloaded, ready-to-use C#-sample (EXE, not
ASP.NET!),
ill get this error.

On my collegues machine, the same things still works fine, even on the
customers
server, but im not able to test/debug this one on my machine anymore.

I dont know, what could be the reason for it.
My XPs configuration seems very identical to my collegues one.
Also my XP Servicepacks, Patches and .NET-Version look identical to
my
collegue ones.
But there must be a difference!

Does anyone has any idea, that maybe can keep me away from a complete
reinstallation of my machine?

Thanks in advance,

ThomasThis exception is also thrown if the statuscode is 404 for example. Have a
look at this:

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebrequestclassendgetresponsetopic.a sp
--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/

"Thomas Geisel" <tgeisel@.symax.de> wrote in message
news:b455c2e.0501180203.cba6e16@.posting.google.com ...
> Hi Everybody,
> after a while, ive had to maintain a ASP.NET/C# project, where
> during processing of an request, the same (local!) webserver is
> requested again for the response of a corresponding aspx-page.
> Something like this:
> ...
> string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
> WebRequest req = WebRequest.Create( uri );
> req.Credentials = CredentialCache.DefaultCredentials;
> WebResponse resp = req.GetResponse();
> Stream st = req.GetResponseStream;
> ...
> This worked fine on my machine a few month ago, as well as on my
> collegues machine and alos at the customer.
> On all 3 machines, the local IIS instance is responsible to process
> the aspx-Request (two XP-SP2, one W2k-Server).
> Acutally, when i perform this again, ill get a
> System.Net.Webexecption
> on the execution of "req.GetResponse()" with following error-stack
> System.Net.HttpWebRequest.CheckFinalStatus()
> System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
> System.Net.HttpWebRequest.CheckFinalStatus()
> myModule.myMethod()
> etc. ...
> This error appears also, when i replace the uri above f.e. with
> 'http://www.google.com'.
> Even when i run a downloaded, ready-to-use C#-sample (EXE, not
> ASP.NET!),
> ill get this error.
> On my collegues machine, the same things still works fine, even on the
> customers
> server, but im not able to test/debug this one on my machine anymore.
> I dont know, what could be the reason for it.
> My XPs configuration seems very identical to my collegues one.
> Also my XP Servicepacks, Patches and .NET-Version look identical to
> my
> collegue ones.
> But there must be a difference!
> Does anyone has any idea, that maybe can keep me away from a complete
> reinstallation of my machine?
> Thanks in advance,
> Thomas