4D Blog

Home Product Customize your email headers

Customize your email headers

May 16, 2019

Product

Custom headers are useful to add information that may not be supported with standard properties. In 4D v17 R5, we’re not only giving you a set of predefined headers, but also a way to declare customized headers to the mail object.

Predefined headers

Five new predefined headers are available directly with the mail object:

  • messageId: Single unique message identifier referring to a particular message version.
  • inReplyTo: Message identifier of the original message to which the current message is a reply
  • references: Collection of message identifier(s) of other message(s) to which the current message may be related.
  • keywords: Object containing important words and phrases that might be useful for the recipient.
  • comments: Contains any additional comments about the text of the body or the message.

 

$email.messageId:="<789e48debe194aa0a0e68354005d7077@4d.com>"
$email.inReplyTo:="<b21f0c56ec634829b7a601c6dc3e3bbe@4d.com>"
$email.references:=New collection("<01a824dd8050407bacd730630348e6a4@4d.com>";"<b21f0c56ec634829b7a601c6dc3e3bbe@4d.com>")
$email.keywords:=New object("mail_4D";True)
$email.keywords["$flagged"]:=True
$email.comments:="This email is sent with the 4D's new SMTP New transporter command"

Custom headers

Need even more headers? No problem, just use the headers collection to add a specific SMTP header to your email:

$email.headers:=New collection()
$email.headers.push(New object("name";"Accept-Language";"value";"fr-FR, en-US"))
$email.headers.push(New object("name";"Importance";"value";"High"))
$email.headers.push(New object("name";"X-Custom-Header";"value";"Your value"))

Below is an example displyaing the importance and keywords headers in a mail client:

 

 

 

Discuss

Tags Mail, SMTP, v17 R5, v18

Latest related posts

  • October 23, 2025

    Starting Qodly studio is just two clicks away

  • October 22, 2025

    Localize your Qodly Pages: A Practical Guide

  • October 21, 2025

    New Way to Control Your HTTP Responses

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