My solution to this problem is some kind of trick!
I use Persian language in mail subject and I send my mail using SmtpClient in .Net framework 4.5.2.
the received message subject shows some garbage words at certain positions e.g 18th and 38th character in subject string. whatever the subject is.
Then I tried inserting some spaces (character 32) in these positions and after re-sending mail the result was very good. the unicode subject was showing as expected.
so I wrote a function to insert 6 spaces in my required positions (avoiding inserting spaces within words) like this :
private static string InsertSpacesBetweenWords(this string subject , int where)
{
int l;
int i=1;
string[] s = subject.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
string output = "";
if (s.Length > 0) output += s[0] + " ";
l = output.Length;
bool done = false;
while (i < s.Length)
{
if (!done)
{
if ((s[i] + output).Length > where)
{
for (int j = output.Length; j < where + 6; j++)
output += " ";
done = true;
}
}
output += s[i] + " ";
i++;
}
return output;
}
then I converted mail subject using this function :
mail.Subject = mySubject.InsertSpacesBetweenWords(38).InsertSpacesBetweenWords(18);
The interesting point is that Gmail and Yahoo mail (and possibly other web based mail systems) ignore the extra spaces and show subject as expected.