5

I am trying to connect to a smtp server of gmail using

telnet gmail.smtp.com 587

It gets connnected when I try it from home. But, it shows an error when I try it from my office. What can be the problem?

Here is the error I get connecting to smtp.gmail.com:

Could not open connection to the host, on port 587: Connect Failed
Gabriel Ilharco
  • 1,649
  • 1
  • 21
  • 34
Vikas Mangal
  • 821
  • 3
  • 10
  • 23
  • How should I configure my firewall so that it allows me to do so ? – Vikas Mangal Feb 28 '14 at 04:46
  • That depends on the protocol but I would start with enabling pot 587... – nonsensickle Feb 28 '14 at 13:32
  • @VikasMangal Can you please have a look at this question? https://stackoverflow.com/questions/52386437/how-to-solve-error-connecting-to-smtp-host-errno-10061-no-connection-could-b – Deva Sep 19 '18 at 06:22

2 Answers2

6

Since you are able to connect at home, your office is probably blocking the port using a firewall. To be sure though, you could try on another network.

T3KBAU5
  • 1,861
  • 20
  • 26
  • I have tried connecting to many servers- yahoo's, hotmail etc. But nothing is getting connected. – Vikas Mangal Feb 28 '14 at 04:40
  • Is the error exactly the same (including port)? If so, then I'd say it's a firewall. – T3KBAU5 Feb 28 '14 at 04:52
  • yes the error is exactly the same. How should I configure my firewall so that it allows me to do so ? – Vikas Mangal Feb 28 '14 at 04:59
  • 3
    You can try to allow the port through your computer's firewall by going to Control Panel > System and Security > Advanced Settings then creating a new inbound and outbound rule for port 587. Set the rule type to port, and the port type as TCP. Once you do this for both inbound and outbound it should work. If it doesn't then your office is blocking it somewhere upstream, so there's nothing you can do about that. – T3KBAU5 Feb 28 '14 at 12:54
  • @T3KBAU5 Can you please have a look at this question? https://stackoverflow.com/questions/52386437/how-to-solve-error-connecting-to-smtp-host-errno-10061-no-connection-could-b – Deva Sep 19 '18 at 06:23
2

Your hostname should be - smtp.gmail.com You wrote - gmail.smtp.com

Please change the name

Nayan
  • 21
  • 1