SMTP error: "The client does not have permission to send mail to this server"

When sending email, the following error appears. What could be the reason?

The client does not have permission to send mail to this server. The server response was: 5.5.1 STARTTLS cannot be repeated.

Here's the stack trace ...

Stack trace

in System.Net.Mail.StartTlsCommand.CheckResponse (SmtpStatusCode statusCode, string response) in System.Net.Mail.StartTlsCommand.Send (SmtpConnection conn) on System.Net.Mail.SmtpConnection.GetConnection (host String, port Int32) in System .Net.Mail.SmtpTransport.GetConnection (host String, Int32 port) in System.Net.Mail.SmtpClient.GetConnection () in System.Net.Mail.SmtpClient.Send (MailMessage message)

I connect to smtp.gmail.com using SSL on port 587/465

+4
source share
2 answers

It looks like you are using an SSL / TLS connection to send a mail message, but for some reason it seems that the code is sending a request to open the connection twice, which is unacceptable. It is difficult to say only from the exception and the stack what the problem is. If possible, send the sending code.

+1
source

Perhaps the SMTP server requires authentication (username / password) and you do not supply them? (Just guess)

0
source

Source: https://habr.com/ru/post/1309286/


All Articles