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

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

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

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • 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 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

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

© 2025 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