We have a .Net WinForms application which can send emails out in English to our customer's clients. This has worked fine for years but recently our customer has reported that emails generated by the system appear to some clients in "Chinese".
This often happens with clients who are using iPhones to read emails but I have seen a screenshot of a client using Thunderbird on Windows where the problem existed.
My thoughts were this must be Encoding related, so I have changed the BodyEncoding property of the .Net MailMessage object to UTF8 but the problem persists.
Dim Mailmsg As New System.Net.Mail.MailMessage
Mailmsg.Subject = Subject
Mailmsg.Body = Body
Mailmsg.To.Add(EmailAddress)
Mailmsg.From = New System.Net.Mail.MailAddress(App.Email, App.FirstName & " " & App.LastName)
Dim _APT_SMPTMAIL As System.Net.Mail.SmtpClient
_APT_SMPTMAIL = New System.Net.Mail.SmtpClient(SMTP)
Mailmsg.BodyEncoding = System.Text.Encoding.UTF8
_APT_SMPTMAIL.UseDefaultCredentials = True
_APT_SMPTMAIL.Send(Mailmsg)
I am at a loss to what to try next or to know whether the problem is a configuration problem on the client's mail server or a problem with our code. We can also not reproduce the problem internally even when accessing email via an IPhone which makes me wonder if it is indeed the mail server.
Turned out to be a problem with the automatic email footer injection our client had configured on Exchange for all outgoing company emails. Beware!