I have a specific requirement to send the user contact details as a Business Card to Outlook using C#.Net, it works perfectly and sends the Business Cards to Outlook however facing an issue when user name is in unicode format.
Sample-1:
- UserName : Crazy
- It works perfectly and able to view the user name without any issues on the outlook.
Sample-2:
- UserName : Müller
- It sends the business card however it is being displayed as "Müller" on the outlook.
the logic used is:
- details will be written into the .vcf file (text file)
- the file will be attached in the mail.
code sample:
System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(filePath);
streamWriter.Write(msgStr);
streamWriter.Close();
streamWriter.Dispose();
Attachment _mailAttachment = new Attachment(filePath);
_mailAttachment.ContentDisposition.Inline = true;
mailMessage.Attachments.Add(_mailAttachment);
client.Send(mailMessage);
even tried to encode the content while writing into the file however does not help.
Any help, how can I fix the issue with the unicode formating?
Sample Vcard content:
BEGIN:VCARD
VERSION:2.1
N;CHARSET=UTF-8;LANGUAGE=en:Müller;Alexander
FN;CHARSET=CHARSET=UTF-8;LANGUAGE=en:Müller Alexander
ORG:CEF Corporate Development Office
TITLE:Service Manager
END:VCARD
but still the name is being displayed as "Müller, Alexander"?