TScSMTPClient - Problem with Umlaute in Emails

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
bij
Posts: 17
Joined: Thu 29 Mar 2007 08:26

TScSMTPClient - Problem with Umlaute in Emails

Post by bij » Wed 17 Nov 2021 14:27

I am using Devart SecureBridge V10.0.1 with Delphi 10.4.2.

This test...

...
ScMailMsg.Subject := 'Umlauttest ÄÖÜäöüß';
ScMailMsg.Body.Text := 'Umlauttest ÄÖÜäöüß';
ScMailMsg.From.Address := 'from@email';
ScMailMsg.From.DisplayName := 'Umlauttest ÄÖÜäöüß';
ScMailAddressItem := TScMailAddressItem.Create(ScMailMsg.ToAddress);
ScMailAddressItem.Address := 'to@email';
ScMailAddressItem.DisplayName := 'Umlauttest ÄÖÜäöüß';
...

results in getting an email with...

subject being: Umlauttest AOUaou?
from address being: Umlauttest AOUaou? <from@email>
to address being: Umlauttest AOUaou? <to@email>
body text being: Umlauttest DV\dv|_

Please help!

bij

YanishevskiyVI
Devart Team
Posts: 55
Joined: Wed 02 Jun 2021 09:30

Re: TScSMTPClient - Problem with Umlaute in Emails

Post by YanishevskiyVI » Thu 25 Nov 2021 15:02

Hi there,

Please be informed, that in order to use umlauts, the appropriate encoding should be applied:

Code: Select all

TScMailMessage.SubjectCharset:='iso-8859-1';//affect to a Subject
TScMailMessage.ContentCharset:='iso-8859-1';//affect to a whole message content
TScMailMessage.HeadersCharset:='iso-8859-1';//affect to message headers, including mail addresses

bij
Posts: 17
Joined: Thu 29 Mar 2007 08:26

Re: TScSMTPClient - Problem with Umlaute in Emails

Post by bij » Fri 26 Nov 2021 08:04

@YanishevskiyVI:
Thanks a million. This did the trick.

Post Reply