1
Below is the Script used when trying to send an error: Failure to an SSPI call. Client and Server cannot communicate because they do not have a common algorithm.
string CorpoEmail = file;
MailMessage mailMessage = new MailMessage();
// Endereco que irá aparecer no e-mail do usuário
mailMessage.From = new MailAddress("[email protected]", "Fale Conosco");
// Destinatarios do e-mail, para incluir mais de um basta separar por ponto e virgula
mailMessage.To.Add(destinatario);
mailMessage.Subject = assunto;
mailMessage.IsBodyHtml = true;
// Conteudo do corpo do e-mail
mailMessage.Body = CorpoEmail.ToString();
mailMessage.Priority = MailPriority.High;
//smtp do e-mail que irá enviar
SmtpClient smtpClient = new SmtpClient();
smtpClient.EnableSsl = true;
smtpClient.Host = "smtp.host.com.br";
smtpClient.Port = 587;
smtpClient.UseDefaultCredentials = false;
//credenciais da conta que utilizará para enviar o e-mail
smtpClient.Credentials = new
NetworkCredential("[email protected]", "senha");
smtpClient.Send(mailMessage);
return true;
The error is not in the code, but in the communication between the server where the application is running and the smtp server. To make sure that you can send an email using any gmail account, for example. As for communication between computers, for some reason the server must be blocking, more information about them will be needed. See: https://technet.microsoft.com/en-us/library/dd197582(v=Ws.10). aspx
– George Wurthmann
I was doing some tests here and I made an example with Python using his SMTP class and be able to do the Email Submission will have some configuration I can do in C# to be able to send ?
– Alan Maik
Have you tried to remove Ssl for a test?
smtpClient.EnableSsl = false;
– George Wurthmann
Yes, I tried there is another error saying that the connection requires starttls, using port 25 can send normally, only I need to send by secure port of Server
– Alan Maik
See if anything of that answer of SO help.
– George Wurthmann