MaikKit fails to authenticate RRS feed

  • Question

  • User-113329956 posted
    I have the code below MimeMessage message = new MimeMessage(); MailboxAddress from = new MailboxAddress("Admin", "myemail@gmail.com"); message.From.Add(from); MailboxAddress to = new MailboxAddress("User", "myemail2@gmail.com"); message.To.Add(to); message.Subject = "Hi user"; BodyBuilder bodyBuilder = new BodyBuilder(); bodyBuilder.TextBody = "message body here"; message.Body = bodyBuilder.ToMessageBody(); SmtpClient client = new SmtpClient(); client.AuthenticationMechanisms.Remove("XOAUTH2"); client.Connect("smtp.gmail.com", 465, true); client.Authenticate("myemail@gmail.com", "pass"); client.Send(message); client.Disconnect(true); client.Dispose(); --- The authentication fails even though credentials are correct. What am I doing wrong here?
    Wednesday, February 10, 2021 7:55 AM

All replies