Customize your email headers

Automatically translated from English

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.references:=New collection("<>";"<>")
$email.keywords:=New object("mail_4D";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:




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.