.NET
Microsoft Technologies based on the .NET software framework.
3,447 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have the following block of code to send an email using MailKit:
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
{
smtp.Connect("mail.somedomainname.com", 587, SecureSocketOptions.StartTls);
smtp.Authenticate("EMAIL ADDRESS GOES HERE", @"PASSWORD GOES HERE");
smtp.Send(email);
smtp.Disconnect(true);
}
When the password in the Authenticate call contains special characters, the authentication will fail. Does anyone know which special characters MailKit will allow/work properly with?
I'm using Visual Studio 2022. .NET Framework 4.8, MailKit version is 3.4.0.0 (runtime version 4.0.30319).
it is most likely an encoding issue. see this thread: