4D Internet Commands v14SMTP_Charset |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D Internet Commands v14
SMTP_Charset
|
SMTP_Charset ( encodeHeaders ; bodyCharset ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
encodeHeaders | Integer |
![]() |
-1 = Use current settings, 0 = Do not manage, 1 = Convert using the specified charset if ISO-8859-1 or ISO-2022-JP, encode extended characters | |||||
bodyCharset | Integer |
![]() |
-1 = Use current settings, 0 = Do not manage, 1= Convert using the specified charset if ISO-8859-1 or ISO-2022-JP | |||||
Function result | Integer |
![]() |
Error Code | |||||
The SMTP_Charset command allows automatic support of messages containing extended characters while sending them with the SMTP_QuickSend or SMTP_Send commands. If this command is not called or has parameters set to 0, version 6.7 or higher of 4D Internet Commands will work the same way as version 6.5.x.
The SMTP_Charset command allows first, to define if the SMTP_SetPrefs bodyType parameter value must be applied to convert the message headers and body, and second, to define if a header containing extended characters must be encoded using the “=?ISO-8859-1?Q?Test=E9?= …” syntax as specified in the RFC#1342. This command has an interprocess scope and will have effect on all subsequent messages sent using the SMTP_QuickSend and SMTP_Send in any 4D process.
This command is particularly useful for supporting extended characters included in the message headers such as Subject or mail addresses (for example, address encoding such as “=?ISO-8859-1?Q?Test=E9?= <test@n.net >”).
Depending on the message headers, encoding (always set to Base64 (except for Subject header) and depending on the SMTP_SetPrefs bodyType parameter value) will be managed as follows:
The encodeHeaders parameter specifies how to handle header conversion and encoding while sending a message. Default value is set to 0.
Note: Extended headers such as “X_…” must use exclusively US ASCII codes.
The bodyCharset parameter specifies how to handle the message body character set conversion while sending a message. Default value is set to 0.
In this example, the subject and the body are converted using the ISO-8859-1 character set, and the subject is encoded following the RFC 1342 syntax:
SMTP_SetPrefs(1;1;0)
$err:=SMTP_Charset(1;1)
$err:=SMTP_QuickSend("mymail.com";"myaddress";"destination";"the Euro €";"the Euro symbol is €")
Product: 4D Internet Commands
Theme: IC Send Mail
Number:
88892
Modified: 4D Internet Commands 6.8.1
4D Internet Commands ( 4D Internet Commands v11.4)
4D Internet Commands ( 4D v13.2)
4D Internet Commands ( 4D Internet Commands v12.1)
4D Internet Commands ( 4D Internet Commands v14 R2)
4D Internet Commands ( 4D Internet Commands v14)
4D Internet Commands ( 4D Internet Commands v14 R3)
4D Internet Commands ( 4D Internet Commands v14 R4)