This error shows up when I try to send mail
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Here is my code:
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient(MySMTPClient);
mail.From = new MailAddress(MySendingAddress);
mail.To.Add(recieverAddress);
mail.Subject = subject;
mail.Body = content;
SmtpServer.Port = MyPort;
SmtpServer.Credentials = new System.Net.NetworkCredential(MySendingAddress, MyPassword);//(MySendingAddress, MyPassword);
SmtpServer.EnableSsl = true;
SmtpServer.UseDefaultCredentials = false;
SmtpServer.Send(mail);