Difference between revisions of "What's new in TSmtpCli V7"

From Overbyte
Jump to navigation Jump to search
 
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
==== UnicodeString ====
+
[[Main_Page | Main page]] -> [[ICS_Components_Reference | ICS component reference]] -> [[TSmtpCli]] -> [[What's_new_in_TSmtpCli_V7 | What's new in TSmtpCli V7]]
 +
 
 +
==== Unicode Changes ====
 
Since Delphi/C++Builder 2009 and better "string" maps to a  
 
Since Delphi/C++Builder 2009 and better "string" maps to a  
 
UnicodeString. That's why the component has to convert these UTF-16
 
UnicodeString. That's why the component has to convert these UTF-16
Line 11: Line 13:
 
conditions met:
 
conditions met:
  
* Property ''CharSet'' is properly set, it defaults to current system ANSI charset.     
+
* Property [[TSmtpCli.CharSet | '''CharSet''']] is properly set, it defaults to current system ANSI charset.     
* Property ''Allow8BitChars'' is set to FALSE.
+
* Property [[TSmtpCli.Allow8BitChars  | '''Allow8BitChars''']] is set to FALSE.
* Property ''DefaultEncoding'' is set to either smtpEnc7bit or smtpEnc8bit.
+
* Property [[TSmtpCli.DefaultEncoding | '''DefaultEncoding''']] is set to either smtpEnc7bit or smtpEnc8bit.
* Message text is assigned to property ''MailMessage'' and property OnGetData is unassigned.
+
* Message text is assigned to property [[TSmtpCli.MailMessage | '''MailMessage''']] and event [[TSmtpCli.OnGetData  | '''OnGetData''']] is unassigned.
  
 
==== Notes on property CharSet (breaking change in V7!) ====
 
==== Notes on property CharSet (breaking change in V7!) ====
* Assigning an unsupported value raises an exception and sets the default system charset.  
+
* Assigning an unsupported value raises an SmtpException and sets the default system charset.  
 
* Assigning an empty string sets the default system charset silently.
 
* Assigning an empty string sets the default system charset silently.
 
   
 
   
Line 24: Line 26:
 
code page identifier it's not guaranteed that this ID is available
 
code page identifier it's not guaranteed that this ID is available
 
and supported by Windows as well. For example, the Chinese character sets are  
 
and supported by Windows as well. For example, the Chinese character sets are  
not supported by default on western Windows installations.
+
not supported by default on western Windows installations unless you install the optional Far-East language pack.
After installation of the optional Far-East language pack those charsets are supported as well.
 
 
   
 
   
Avoid use of "utf-7", since UTF-7 not very well supported by the component,
+
Avoid use of "utf-7", UTF-7 does not yet work very well, instead use "utf-8" if you want to send UNICODE.
instead use "utf-8" if you need to send UNICODE.
+
 
 +
==== New Property ConvertToCharset ====
 +
If set to TRUE enforces charset conversion to the character set specified in property CharSet. This property is ignored by UNICODE compilers.
 +
 
 +
==== Misc New Features ====
 +
Methods [[TSmtpCli.CalcMsgSize | CalcMsgSize]], [[TSmtpCli.CalcMsgSizeSync | CalcMsgSizeSync]] and event [[TSmtpCli.OnMessageDataSent | OnMessageDataSent]]. Public property [[TSmtpCli.MessageSize | MessageSize]]. Method [[TSmtpCli.MailFromSIZE | MailFromSIZE]]. Properties [[TSmtpCli.SizeSupported | SizeSupported]] and [[TSmtpCli.MaxMessageSize | MaxMessageSize]].

Latest revision as of 16:46, 30 May 2009

Main page -> ICS component reference -> TSmtpCli -> What's new in TSmtpCli V7

Unicode Changes

Since Delphi/C++Builder 2009 and better "string" maps to a UnicodeString. That's why the component has to convert these UTF-16 strings to ANSI strings with a correct code page first before transmission. Also SMTP allows 7-bit ASCII chars in the range hex 00-7F only. So if the (converted) AnsiString contains characters in the 8-bit range (hex 80-FF) it has to be encoded with a proper transfer-encoding as well.

TSmtpCli V7 is capable to perform the right string conversion and encoding automatically in the background, provided the following conditions met:

Notes on property CharSet (breaking change in V7!)

  • Assigning an unsupported value raises an SmtpException and sets the default system charset.
  • Assigning an empty string sets the default system charset silently.

Mapping of MIME charset names to Windows code page identifiers is done in new unit OverbyteIcsCharsetUtils. If a charset name is mapped to a code page identifier it's not guaranteed that this ID is available and supported by Windows as well. For example, the Chinese character sets are not supported by default on western Windows installations unless you install the optional Far-East language pack.

Avoid use of "utf-7", UTF-7 does not yet work very well, instead use "utf-8" if you want to send UNICODE.

New Property ConvertToCharset

If set to TRUE enforces charset conversion to the character set specified in property CharSet. This property is ignored by UNICODE compilers.

Misc New Features

Methods CalcMsgSize, CalcMsgSizeSync and event OnMessageDataSent. Public property MessageSize. Method MailFromSIZE. Properties SizeSupported and MaxMessageSize.