When I run my app locally and click send on my contact form, I receive this error
Syntax error, command unrecognized. The server response was:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Net.Mail.SmtpException: Syntax error, command unrecognized. The server response was:
Line 65: await smtp.SendMailAsync(message);
I'm fairly new to creating contact forms. I'm using my gmail account to send details from user back to my mail
smtp.Credentials = credential;
smtp.Host = "smtp.gmail.com";
smtp.Port = 465; // SHOULD BE 587
smtp.EnableSsl = true;
await smtp.SendMailAsync(message);
return "sent";
Thanks in advance!
[SmtpException: Syntax error, command unrecognized. The server response was: ]
System.Net.Mail.ConnectAndHandshakeAsyncResult.End(IAsyncResult result) +1885147
System.Net.Mail.SmtpTransport.EndGetConnection(IAsyncResult result) +31
System.Net.Mail.SmtpClient.ConnectCallback(IAsyncResult result) +49
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92