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.
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
Log on to the Message Service console.
On the left-side navigation pane, click Queues.
At the upper-right corner, click Create Queue. A dialog box appears.
Enter the queue name, use the default values for other fields, and click OK.

Create an event notification rule
On the left-side navigation pane on the Message Service console, click Event Notification.
Select the region and product name.
At the upper-right corner, click Create Rule.
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.
Create an account-level asynchronous notification.
Log on to DirectMail console.
On the left-side navigation pane, click Asynchronous Notifications.
At the upper-right corner, click New Account-level Asynchronous Notifications.
Select the region and click OK.

Create an email address-level asynchronous notification.
Click Email Address-level Asynchronous Notification on the Asynchronous Notifications page.
At the upper right corner of the page, click New Address-level Asynchronous Notifications.
Select the sender address and region, and click OK.

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.
Log on to the Message Service console.
On the left-side navigation pane, click Queues.
Select the region to view the active messages in the queue created for DirectMail messages.
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&msg_id=37483d95-7a08-41fb-9738-3d3ffa24d415@example.com&account=example@example.com&from=example@example.com&rcpt=example1@example.com&recv_time=2017-03-29 14:22:40&end_time=2017-03-29 14:22:43&status=0&event=deliver®ion=cn-hangzhou&err_code=250&err_msg=250 Send Mail OK&failed_type=SendOk
env_id=12625010655&msg_id=ac349efc-0d79-489b-affa-f178dce3e49e@example.com&account=example@example.com&from=example@example.com&rcpt=example1@example.com&recv_time=2017-03-28 19:09:49&end_time=2017-03-28 19:09:51&status=4&event=deliver®ion=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
Name | Description |
---|---|
env_id | System internal ID (used for feedback of inquiries). |
msg_id | The Message-ID field of the email text. |
account | The sender address. |
from | The sender address. |
rcpt | The recipient address. |
recv_time | The time when the email is received in the queue. |
end_time | The time when the email delivery is completed. |
status | The results of the delivery (0-success, 2-invalid address, 3-spam mail on the receiving side, 4-failure). |
err_code | The ESP return code from the receiving side after the delivery is done. |
err_msg | The ESP return information from the receiving side after the delivery is done. |