1

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.

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
    Jun 12, 2010 at 11:22

1 Answer 1

2

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?

1
  • 1
    To 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
    Jun 12, 2010 at 11:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .