Saturday, February 6, 2016

Why do the emails I send from C# have double periods in them, sabotaging URLs?

This explains what is happening with System.Net.Mail and offers that the solution lies in this setting:

using (var email = new MailMessage(foo, bar, baz, qux))
{
      email.BodyEncoding = System.Text.Encoding.UTF8;
      email.IsBodyHtml = true;
      mySmtpClient.Send(email);
}

No comments:

Post a Comment