Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMTP error: "Client does not have permission to submit mail to this server"

Tags:

c#

smtp

I'm getting the following error while sending email. What could be the cause?

Client does not have permission to submit mail to this server. The server response was: 5.5.1 STARTTLS may not be repeated.

Here's the stack trace...

Stack Trace

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

I'm connecting to smtp.gmail.com with SSL on port 587 / 465

like image 817
Raj Kumar Avatar asked Nov 06 '22 13:11

Raj Kumar


1 Answers

It appears you are using an SSL/TLS connection to send the mail message, however it appears for some reason that the code is sending the request to open the connection twice which is not valid. Hard to tell just from the exception and stack what the problem is. Post the sending code if possible.

like image 101
Brent Pabst Avatar answered Nov 14 '22 22:11

Brent Pabst