REMAKING QUESTION
This code doesn't work
The error is: The remote certificate is invalid according to the validation procedure.
var client = new SmtpClient("smtp.domain.com.br", 25000)
{
Credentials = new NetworkCredential("username", "password"),
EnableSsl = true
};
client.Send("emailfrom@domain.com.br", "emailto@gmail.com", "test", "testbody");
// I also tested like this
// client.Send("emailfrom@domain.com.br", "emailto@domain.com", "test", "testbody");
But this code works
var client = new SmtpClient("smtp.gmail.com", 587)
{
Credentials = new NetworkCredential("username", "password"),
EnableSsl = true
};
client.Send("emailfrom@domain.com.br", "emailto@gmail.com", "test", "testbody");
I tested the first code data in the Outlook, and works if I try to send to an email from the same domain.
I believe that the error is some SMTP configuration, but I don't know how to solve this. Any help?