Is this error because GMail is blocked? - c#

I wrote a simple app to send an email via GMail SMTP servers. However, it returns an exception at runtime.
At my workplace gmail is blocked (cannot access gmail.com). Is this error because of that?
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebExceptio
n: Unable to connect to the remote server ---> System.Net.Sockets.SocketExceptio
n: A connection attempt failed because the connected party did not properly resp
ond after a period of time, or established connection failed because connected h
ost has failed to respond 74.125.113.109:587

Yeap, it looks like it is related to that. The request could be blocked by the firewall.

They are most likely blocking outbound traffic on port 587.

The answer is probably yes. There is a small possibility that the gmail server was down when you tried to access it, but it's clear that since you're blocked, you won't be able to connect.

No, it's because your network administrator has blocked this IP or port in the company's firewall.

Yes, the exception is coming up because the connection failed, but it might not necessarily be because it's blocked. I can't even connect to that host:
> telnet 74.125.113.109 587
Trying 74.125.113.109...
telnet: connect to address 74.125.113.109: Connection refused
Edit: on second look, I can connect to that host from another machine. There might be other connectivity issues afoot.

Related

Error while trying to call a wcf service

I'm trying to connect to a WCF service on a server.
I've set up a Site in the IIS on the server and set the Enabled Protocols to http,net.tcp.
Additionally, I configured the Site Bindings like this:
http > Port: 80 > IP Address: *
net.tcp > Binding Information: 808.*
Under Authentication, I've enabled Anonymous Authentication and Windows Authentication.
The services Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service are running too.
When I call the webservice with a browser (via http), everything works and I can list the wsdl etc.
But when trying to connect via tcp, I get the following error:
Error: Cannot obtain Metadata from net.tcp://myserver/MyService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: net.tcp://myserver/MyService.svc Metadata contains a reference that cannot be resolved: 'net.tcp://myserver/MyService.svc'. Could not connect to net.tcp://myserver/MyService.svc. The connection attempt lasted for a time span of 00:00:21.0010999. TCP error code 10060: 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 10.x.yyy.zz:808. 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 10.x.yyy.zz:808
Are there any other things I have to make sure to be able to connect via tcp?
Thanks in advance
This seems to be a network issue since 10060 means connect timeout.
Check the server firewall and make sure that Windows Communication Foundation Net.TCP Listener Adapter (TCP-In) rule is enabled.
Check the client computer's firewall and add make sure an outbound rule allowing tcp connections on port 808
If you still can't connect, a network firewall device might be blocking the request
I think that you may need to turn metadata exchange on:
The following explains one way to do it.

SOAP Service "A socket operation was attempted to an unreachable host"

I'm using C# WinForms app to receive data from the remote SOAP service and it's working great on every testing machine with VPN connected/disconnected.
But there is an exception on one PC after connecting it to VPN network:
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: A socket operation was attempted
to an unreachable host XX.XX.XX.XX:443
If it's not connected to VPN its receiving data from the service as intended.
What's wrong there? I've tried to disable AVG and firewall but no success.
Is there port blocked after VPN connected or maybe VPN using the same port?... I really don't know what to do :)
netstat doesn't show 433 port in use, btw
I guess this is port issue but who knows...

Error in connecting wcf service from android. Error: Failed to connect to /10.0.2.2

While calling wcf ksoap2 from android.
htp.call(SOAP_ACTION, soapEnvelop);
I am getting this exception.
java.net.ConnectException: failed to connect to /10.0.2.2 (port 52442)
after 20000ms: connect failed: ENETUNREACH (Network is unreachable)
My code was working fine till last night but now its not.
Thanks in advance
It's obvious it's not any router-firewall related problem as you are under the same net, so there are only three possibilities:
There's nothing listening on that port on that IP
There's a local firewall on that machine that is blocking that connection attempt
You are not using WIFI so you're not under the same net.
Can you open that URL from your browser in your computer manually? If yes, I'd suggest using some debugging tool to trace TCP packets (I don't know either what kind of operating system you use on the destination machine; if it's some linux distribution, tcpdump might help).
All that assuming you have the android.permission.INTERNET permission in your AndroidManifest.xml file.

Cannot deploy my web application to remote location through MS build. This error comes up everytime

I am working on a big enterprise environment. When i try to deploy my solution to remote sever using ms build i get this error every time i try to deploy the app.
According to the error message it says it cannot connect but i can ping to the ip. I have even added the host ip and names in both machines host files. I don't know if i am doing anything wrong has anyone come across this before.How did you overcome this?
Note: i have replaced my ip with myip.com... and site name as my site name in this question.(My app is Asp.net MVC 4 Application)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (3847): Web deployment task failed.(Could not complete the request to remote agent URL 'https://myip.com/msdeploy.axd?site=my site name'.) This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server. Error details: Could not complete the request to remote agent URL 'https://myip.com/msdeploy.axd?site=my site name'. Unable to connect to the remote server 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 myip.com
Any help will really be appriciated
The real error message is buried in the report, but it reads:
"Unable to connect to the remote server 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 myip.com"
This is a TCP connection problem, which means there's probably a simple solution.
It should be straightforward: it means the server you've specified is not operational. If you're certain that your website is currently working (i.e. you can get to it from your web-browser) then it means you've mistyped the server's name or other connection details. It does not mean that msdeploy.axd is having problems because if it were, your client would at least be able to connect.
Check your server's firewall rules, and also ensure that the web server (IIS) is running and is actively listening on the IP address you want (check the site bindings and also the server's network configuration, a dump of ipconfig /all would also be useful).
It was the issue with IIS it was not allowing remote connections. fixed it by allowing remote connections.
In my case it was due to the firewall setting of the host machine. Turning off firewall for local network fixed the problem

Sending out an email using SMTP

I am using the Send Mail Task in SSIS 2008 to send out an email.
I am using SMTP. I have SMTP set up in the IIS manager.
I have set it to use windows authentication.
The From and To mail address both exist.
When i configure the task to send an email, i get an error
"[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail.
System.Net.WebException: Unable to connect to the remote server System.Net.Sockets.SocketException:
No connection could be made because the target machine actively refused it 127.0.0.1:25"
What IIS or SSIS config change has to be made for this to work?
Check your firewall and/or virus scanner; port 25 (the default SMTP port) is often blocked by this type of software. Not sure about the SSIS Send Mail Task specifically, but SQL Server SMTP Mail service can be configured to use a different port.
If you're in a corporate environment, it's likely that your network guys have some sort of SMTP relay you could/should use instead of the local host, and they might also have some sort of IP and/or email address whitelist they need to include you on in order to relay SMTP mail.
you need to have a valid SMTp server. The error message said you can not use local machine as SMTP server. you can try use gmail.com as a relay server.
Don't use the loopback IP address: try localhost or actual machine name etc
Edit: found a reference to say that 127.0.0.1 needs added to allowed IP addresses. Now, can't say if this applies to your case, but I'm sure I read something years ago about this

Categories