Send email through SMTP object class

0

I'm trying to send emails using SMTP client, and following the example in the documentation at UltimateMail I'm not getting success.

I'm trying exactly like this:

 

SmtpClient client = new SmtpClient();
string server = "serverName"; 
 
// Connect to the server.
client.Connect(server,25, SecurityMode.Implicit);
 
and I'm receiving an error: Fatal error 'ProtocolVersion' has been encountered on the local connection end" 
Does any of you know explain me what it means ?
 
I've tried another way but I also receiveid errors. Below there is the code I've used to simulate it
 
// Create a new instance of the SmtpClient class.
SmtpClient client = new SmtpClient();
string server = "serverName"; 
 
// Connect to the server.
client.Connect(server, 25);
client.Authenticate("user", "pass"); 
 
I'm receiving this error: None of the supported authentication methods is accepted by the server.

 

Not sure what's going on here, does any of you faced a problem similar like this one ?

edited 11/30/2017 11:12:59 AM
asked 7/24/2012 5:01:18 PM
add a comment

1 Answers

0

That error indicates that you are using wrong security settings or port number.

If you wish to connect to a secure server using Implicit mode (like Gmail)

[code lang='c#']SmtpClient client = new SmtpClient();

// Connect to the server.

client.Connect("smtp.gmail.com",465, SecurityMode.Implicit);[/code]

 

In case you got None of the supported authentication methods is accepted by the server. just dont use Authenticate method because many SMTP servers just need the sender email

 

[code lang='c#']SmtpClient client = new SmtpClient();

// Connect to the server.

client.Connect("myserver",25);

client.Send(...);[/code]

 

 
answered 11/16/2017 12:41:36 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged mail smtp or ask your own question.