Support > Repository > Application example > Mail thread display using mail header
ja | en

We will show you how to deal with thread display of e-mail software by specifying Message-ID and In-Reply-To which are header information of e-mail.

Before reading this page,Send mail (fix mail template)Please look through.

In this example, let's assume that the message ID is "<JasmineSoft primary key number.transmission number @ jasminesoft.co.jp>" and the first message ID (mail address indicated) as the reply destination.

Figure 1 shows the screen where the first mail was sent automatically after new registration."Message ID" and "Reply-To" are used for Message-ID and In-Reply-To of the mail header respectively.

Figure 1 Message ID and reply destination used for automatic mail transmission immediately after new registration

Figure 2 shows the automatic mail transmission immediately after the first update.The number of mail transmission times is "2" and the message ID is also ".2".The reply destination does not change.

Figure 2 Message ID and reply destination used for automatic mail transmission at the first update

Figure 3 shows the automatic mail transmission immediately after the second update.The number of mail transmission times is "3", and the message ID is also ".3".The reply destination does not change.

Figure 3 Message ID and reply destination used for automatic mail transmission at the next update

This is the mail sent automatically in Figs. 1 to 3.You can see that it corresponds to thread thread display of mail.

Figure 4 Corresponds to thread thread display of mail

Model definition

Figure 5 shows the definition of the customer model that sets the mail sending function.Three items of "mail transmission frequency" "message ID" "reply destination" are the key points.

Figure 5 Defining customer model

Sending mail settings

In this time, automatic mail transmission is done at the time of data registration and update. Suppose we prepare a mail template separately for registration and update.

In order to increment (increment by 1) the "number of mail transmission" item at the time of successful transmission, the following expression is set.

${mailsend_cnt}=${mailsend_cnt}+1
Fig. 6 Mail transmission settings

Message ID item

Set the following formula according to automatic mail transmission at the time of data registration and update.

CONCATENATE("<JasmineSoft", TOSTR(${customerid}), ".", TOSTR(${mailsend_cnt}), "@jasminesoft.co.jp>")
Figure 7 Message ID expression (executed at registration and update)

CONCATENATEThe function combines strings of arguments.
TOSTRThe function converts the numeric value of the argument to a string.Since the customerid item is numeric in the example, the TOSTR function is applied.
Please replace "JasmineSoft" or "@ jasminesoft.co.jp" string appropriately.

This item is read-only so that it can not be input.

Figure 8 Read-only setting

Reply-to item

Empty when registering.Each time it is updated, it is recommended to store the first message ID (state of transmission number 1).

CONCATENATE("<JasmineSoft", TOSTR(${customerid}), ".1@jasminesoft.co.jp>")
Figure 9 Expression of reply destination (empty at registration, executed only at update)

This item is also read-only so that it can not be entered.

10

mail template

mail templateNow specify the mail header as shown in Figure 11.

Fig. 11 Mail header setting

The format of Message - ID and In - Reply - To is specified in RFC, and if you send mail in an illegal format, there is a possibility that problems may occur in mail server and mail client.For details, please refer to the following URL.

RFC 2822 "Internet Message Format"
http://www.ietf.org/rfc/rfc2822.txt