System.Net.Mail and =?utf-8?B?XXXXX…. Headers

When your subject contains characters outside the ASCII range, then the mailing software must encode them (RFC2822 mail does not permit non-ASCII characters in headers). There are two ways to do this: Quoted Printable (subject starts with “=?utf-8?Q”) Base64 (subject starts with “=?utf-8?B”) It appears that the framework has figured that the Base64 encoding is … Read more

Send SMTP email using System.Net.Mail via Exchange Online (Office 365)

Fixed a few typos in the working code above: MailMessage msg = new MailMessage(); msg.To.Add(new MailAddress(“[email protected]”, “SomeOne”)); msg.From = new MailAddress(“[email protected]”, “You”); msg.Subject = “This is a Test Mail”; msg.Body = “This is a test message using Exchange OnLine”; msg.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential(“your user … Read more