4D Blog

Home Product Legacy charset support with 4D email

Legacy charset support with 4D email

June 3, 2019

Product

If you still need to communicate with old devices that don’t support Unicode, this blog post is for you! Keep reading because with 4D v17 R5, you can send emails in legacy encodings (ISO-2022-JP for Japanese or ISO-8859-1 for Western European).

The SMTP New transporter command accepts new parameters so you can specify the type of encoding to use in the header or body. For example, if you want to send an email in Japanese and use the ISO-2022-JP encoding, simply write:

$smtp:=New object
$smtp.host:="smtp.yoursmtp.com"
...
// Define the type of encoding to use in your body parts
$smtp.bodyCharset:=mail mode ISO2022JP
// Define the type of encoding to use in your mail header
$smtp.headerCharset:=mail mode ISO2022JP
$smtpTransporter:=SMTP New transporter($smtp)
 
$email.from:="アリス <alice@mail.com>"
$email.to:="八郎 <hachiro@mail.com>"
$email.subject:="メールの送信"
$email.textBody:="4D v17 R4 以降、新しい方法でeメールの作成と送信ができるようになりました。"
 
$smtpTransporter.send($email)

4D uses the ISO-2022-JP charset when it converts your mail to MIME:

MIME-Version: 1.0
Date: Wed, 13 Mar 2019 15:32:16 GMT
Message-ID: <843E4861CC54404F8597E65974A4832D>
Sender: =?ISO-2022-JP?Q?=1B$B%"%j%9=1B=28B?= <alice@mail.com>
From: =?ISO-2022-JP?Q?=1B$B%"%j%9=1B=28B?= <alice@mail.com>
To: =?ISO-2022-JP?Q?=1B$BH=2CO=3A=1B=28B?= <hachiro@mail.com>
Subject: =?ISO-2022-JP?Q?=1B$B%a!<%k$NAw?.=1B(B?=
Content-Type: text/plain; charset="ISO-2022-JP"
Content-Transfer-Encoding: 7bit
 
4D v17 R4 $B0J9_!"?7$7$$J}K!$G(Be$B%a!<%k$N:n@.$HAw?.$,$G$-$k$h$&$K$J$j$^$7$?!#(B

More details can be found on the doc center.

Discuss

Tags Mail, SMTP, v17 R5, v18

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • AI
  • 4D Write Pro
  • Email, Microsoft 365, Gmail
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • 4D Qodly Pro
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy