"Could not open connection to the host" error when trying to send email using telnet

0

I need to send email from my ASP.NET application. For that I am using the following command from the command prompt to connect to the specific port on tk2smtp:

telnet tk2smtp.msn.com 22

But it's showing the following error on the command prompt:

Could not open connection to the host

I installed a telnet client in my machine. Let me know if there are any other things to be configured for this.

hima

Posted 2010-06-12T11:08:07.573

Reputation: 1

Not a direct answer to your question, but: why not use some SMTP library? And why not use the SMTP server of your own provider, rather than the MSN server? Like maybe even telnet localhost 25 on the web server? – Arjan – 2010-06-12T11:22:06.290

Answers

1

It's very common to block (unauthorised) access to SMTP servers to prevent spam relay. If telnet tk2smtp.msn.com 25 could not open a connection, then there's nothing you can do your end.

Some servers use a different port and/or encryption, like the "message submission port" 587. Or like 465 for secure SMTP, but then you would need some library rather than plain telnet.

Where did you get the details from?

Andy

Posted 2010-06-12T11:08:07.573

Reputation: 2 959

1To be more precise: any SMTP server must accept unencrypted, anonymous connections for delivery of messages to its own users, hence: for messages to be sent to the users of its own domain. But: once connected, it might indeed disconnect if you're trying to send messages to users on another domain. So, it's more likely that the port is blocked by some firewall or by the internet or hosting provider (if that tk2smtp.msn.com server is correct). – Arjan – 2010-06-12T11:34:49.257