0 votes

Good morning, people.
I'm developing an eMail application in C#, using the Mail dll. I've tried to connect to my Hotmail address using the app, inputing my mail username and password, but after a while it throws the "Authentication Failed" exception. I've checked my pass and username, and are ok both.

Also I've checked the Hotmail's SMTP (smtp.live.com), and it's ok too.

Here is the piece of code that I'm using to reach the connection:

 iCliente.Connect("smtp.live.com");
 iCliente.StartTLS();
 iCliente.UseBestLogin("xxxxxxx@hotmail.com", "password");
 MessageBox.Show("The connection to the server was successful!");

Then when I try to reconnect inputing my pass again, it throws this C# error: "There has been a connection request to an already connected socket: << IP ADDRESS HERE >>". It looks like the connection was "successful" but it doesn't work either.

Can you give me an advice to solve this?

by

1 Answer

0 votes

If you got an exception previously, you must dispose and recreate Smtp class instance. In most cases it is unusable after exception occurred.

Remember invoking Dispose or use using clause.

after a while it throws the "Authentication Failed" exception

Has your account been locked?

by (301k points)
...