All Products
Document Center

Set up asynchronous notifications

Last Updated: May 16, 2022

After you send an email request to the DirectMail server, the delivery results is returned to you synchronously. The delivery results are stored in the Message Service receiving terminals (HTTP, message queue, subject) following the event notification rules that you have created in Message Service. You can get the delivery results asynchronously using the Message Service receiving terminals.

To set up asynchronous notifications, first activate Message Service.Message Service may incur additional fees.

Create event notification rules

We recommend that you create a message receiving queue first before you create a notification rule to function as the message receiving terminal.

Create a message receiving queue

  1. Log on to the Message Service console.

  2. On the left-side navigation pane, click Queues.

  3. At the upper-right corner, click Create Queue. A dialog box appears.

  4. Enter the queue name, use the default values for other fields, and click OK.


Create an event notification rule

  1. On the left-side navigation pane on the Message Service console, click Event Notification.

  2. Select the region and product name.

  3. At the upper-right corner, click Create Rule.

  4. Check the region and product name, enter the rule name, select the event type, add the receiving terminal, and click OK.

    Currently, the system supports two types of receiving terminals (HTTP, queue). For this configuration, select the previously created message receiving queue as the receiving terminal.


Note: Generally it takes up to 10 minutes for the newly created rule to take effect.

Create asynchronous notifications

Asynchronous notifications can be divided into asynchronous notifications at the account level and at the sender address level.

If you want to implement asynchronous notifications about delivery results for all sender addresses, you can set the account-level asynchronous notifications.

If you want to implement asynchronous notifications about delivery results for specific sender addresses, you must set the email address-level asynchronous notifications for the specific sender addresses.

You can also set both. The email address-level asynchronous notifications have a higher priority level than the account-level ones. The specified sender addresses get the email address-level asynchronous notifications, while all other sender addresses get the account-level asynchronous notifications. This allows you to send notifications for specific accounts to different message receiving terminals.

Create an account-level asynchronous notification.

  1. Log on to DirectMail console.

  2. On the left-side navigation pane, click Asynchronous Notifications.

  3. At the upper-right corner, click New Account-level Asynchronous Notifications.

  4. Select the region and click OK.异步通知0

create notification

Create an email address-level asynchronous notification.

  1. Click Email Address-level Asynchronous Notification on the Asynchronous Notifications page.

  2. At the upper right corner of the page, click New Address-level Asynchronous Notifications.

  3. Select the sender address and region, and click OK.异步通知1

Create address-level notification

Receive messages in the queue

After sending an email request through the DirectMail server, you can view the notifications pushed to the queue on the Message Service console.

  1. Log on to the Message Service console.

  2. On the left-side navigation pane, click Queues.

  3. Select the region to view the active messages in the queue created for DirectMail messages.

  4. Click Receive Message to view the specific event notifications pushed to the queue.


Descriptions of the message content is as the following:

env_id=12769055421& 14:22:40&end_time=2017-03-29 14:22:43&status=0&event=deliver&region=cn-hangzhou&err_code=250&err_msg=250 Send Mail OK&failed_type=SendOk

env_id=12625010655& 19:09:49&end_time=2017-03-28 19:09:51&status=4&event=deliver&region=cn-hangzhou&err_code=524&err_msg=524 Host not found by dns resolve [@ou070302]&failed_type=SysOutDnsResolveFail

err_code 250 indicates that sending succeeded. Any other return codes indicate that sending failed.

Appendix: List of message content parameters




System internal ID (used for feedback of inquiries).


The Message-ID field of the email text.


The sender address.


The sender address.


The recipient address.


The time when the email is received in the queue.


The time when the email delivery is completed.


The results of the delivery (0-success, 2-invalid address, 3-spam mail on the receiving side, 4-failure).


The ESP return code from the receiving side after the delivery is done.


The ESP return information from the receiving side after the delivery is done.