Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send mail containing special characters

Status
Not open for further replies.

Kenbla

Programmer
Oct 11, 2006
68
0
0
SE
Hi all, I have a Delphi XE application which sends mails upon request. The mail function works rather well but I sometimes have a problem with the swedish special characters åäö and ÅÄÖ. When I send a mail to a number of recipients it looks OK for most of them but not for all! The special characters doesn't display correctly for those individuals!
I set the charset property like this: MailMessage.CharSet := 'utf-8';

I have also tried to use:
[ul]
[li]MailMessage.Encoding := meMIME;[/li]
[li]MailMessage.Body.Text := UTF8Encode(sMsg);[/li]
[li]MailMessage.Subject := UTF8Encode(txtAmne.Gettext);[/li]
[/ul]
None of the above have helped!
Some of the recipients run 64 bit Windows and they get the mail with corrupt special characters!
I should also mention that the recipients of the mail are spread all around the world.
Any suggestions?
Regards,
Kenbla
 
I'm using the TidSMTP and TidMessage classes to send e-mail
 
Perhaps try defining your strings as AnsiString instead of String or WideString instead of string. Perhaps you are experiencing a unicode issue.
 
Thanks for your advice. I have tried it but unfortunately it didn't help. It still looks the same!
 
What client is displaying the received e-mail message? Is it unicode compliant?
 
The mails that are sent from my Delphi application goes to one mailserver and that mailserver distributes the mail to a number of different mailservers across the world. I don't have any idea what the client PC's looks like.
Can the different mailservers and/or client PC's be "unicode uncompliant"?
 
Mailservers usually handle unicode correctly, but mail-clients don't have to comply to anything.
Who, using what mail-client, is complaining that it's not displaying correctly, and how have you checked & confirmed for yourself?
 
Hello, and thanks for your replies.
I don't have any idea what mail-clients the users have! They are spread around the world at different companies. I use MS Outlook and it works fine when I receive the mailmessages.
 
Download some other popular clients and see how they handle your emails. Examples would be: The Bat!, Pegasus Mail, Thunderbird, and smartphones.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top