All Products
Search
Document Center

Direct Mail:Email sending FAQ

Last Updated:Oct 29, 2025

Issues with sending email.

What sending methods does Direct Mail support?

Direct Mail supports three sending methods:

What types of emails can I send with Direct Mail?

You can use Direct Mail to send transactional emails and batch emails.

  • Transactional emails: Emails triggered by events, such as registration notifications, transaction alerts, and password reset confirmations.

  • Batch emails: Emails sent to subscribers, such as product promotions, customer newsletters, and updates. With Direct Mail, you can only send commercial emails that recipients have opted in to receive. The recipient addresses must be obtained from member registrations, and recipients must have actively subscribed to the content. Sending unsolicited spam is not allowed.

Can I add attachments to emails?

You cannot add attachments when you send emails from the Direct Mail console or using the API.

You can add attachments when you send emails using SMTP. For more information, see How do I send an email with an attachment using SMTP?

Why is port 25 unavailable for SMTP services?

For security reasons, port 25 is disabled on ECS instances.

If your sending program is deployed on an Alibaba Cloud ECS instance, you can use port 80 without SSL or port 465 with SSL.

Why are my emails going to the recipient's spam folder?

Whether an email is sent to the spam folder is determined by the recipient's anti-spam policy. The sender cannot view the specific reasons.

Suggestions for handling spam classification

  • Optimize your content:

  1. Adjust the email content to avoid words commonly found in spam.

  2. If the email content includes website links, avoid using URL shorteners. Shortened links can be flagged as spam.

  3. Add a working unsubscribe link to your email content. You should also prominently ask recipients to add your sender address to their whitelist or contact list and include an introduction to your company and product.

  • Warm up your sender address:

  1. Each receiving mail system has different, multi-dimensional, and frequently changing throttling mechanisms that are difficult to build into the sending platform. Therefore, you should start by sending a reasonable initial volume of emails. Then, you can gradually increase the volume based on delivery errors and open rates.

  • Other suggestions:

  1. If the recipients are internal to your company, contact the recipient's email administrator to add your sender address to the whitelist.

  2. Sending emails with the same subject to multiple recipients at the same time can also be flagged as spam. You should avoid frequently sending emails with the same subject to many recipients. If your business requires this, you can contact the recipient's mail service provider for adjustments.

  • How to improve email content quality:

  1. Before you send an email, you can use this website to test it. Send your email content to the test mailbox to check whether it will be considered spam. You can then use the feedback to improve your email quality.

Note: This website is for reference only. Each email service provider has a different anti-spam system. However, the website can help you improve the quality of your email content.

Suggestions for handling invalid addresses

The console identifies invalid addresses to help you remove them from your recipient lists and reduce the invalid address rate.

Procedure:

In the Direct Mail console, go to Data Statistics > Invalid Addresses. You can then export the list of invalid addresses and remove them from your recipient list.

The system automatically adds an address to an invalid address database if multiple delivery attempts to that address fail. When you send an email to an address in this database, the email is rejected. If you are sure that an address is valid, you can contact us to remove it from the invalid address database.

  • If you use a recipient list in the console, you must remove the invalid addresses and then re-upload or edit the list.

  • If the addresses are from registered members, you must first purge the invalid addresses. Then, you can add an email validation step to your registration process. For example, you can perform a preliminary check when a user registers or an event is triggered. You can query the DNS server for an MX record. If no MX record is found, the address is considered invalid, assuming normal network communication.

  • If your invalid address rate is too high, you must purge the invalid addresses before you can request a quota increase or have a block lifted.

How to choose a sending region

1. Prerequisite: The region that you choose determines where your data is stored. If you have international customers, you must consult your company's legal department to determine which region complies with data residency requirements.

2. If your sending program is deployed in mainland China, you must select the China (Hangzhou) region.

3. If your sending program is deployed outside mainland China and most of your recipients are also outside mainland China, you can use a region such as Singapore or a US region.

4. If your sending program is deployed outside mainland China but most of your recipients are in mainland China:

a) If your program sends emails using SMTP and is deployed in the US or Singapore, you must select the China (Hangzhou) region. Your traffic is automatically routed to the China (Hangzhou) node through an accelerated node in the US or Singapore.

b) In other cases, you must use the Singapore region.

How to troubleshoot sending issues

First, determine which sending method you are using. Check whether there are any returned messages or exceptions. Then, follow the corresponding suggestions.

API

  • If there is a returned message or exception

1. Check the error code in the API reference.

  • If there is no returned message or exception

1. Confirm that you are using the correct Direct Mail region. Check whether the `region` parameter is consistent with your Direct Mail region and whether the AccessKey pair is correct.

2. Check whether the parameters are configured as described in the documentation. Check whether the parameter values match the settings in the console and whether the server time zone meets the requirements in the documentation.

3. Check whether the signature is correct. Pay special attention to the replacement of special characters.

  • If the issue persists, you can refer to and use the code in the request example. For more information, see Request example (Java).

  • If you still cannot resolve the issue, you must provide the API name, the parameters that are used in the call, the exception or returned message, and the sanitized code.

SDK

  • If there is a returned message or exception

1. Check the error code in the API reference.

  • If there is no returned message or exception

1. Confirm that you are using the correct Direct Mail region. Check whether the `region` parameter is consistent with your Direct Mail region and whether the AccessKey pair is correct.

2. Check whether the parameters are configured as described in the documentation. Check whether the parameter values match the settings in the console and whether the server time zone meets the requirements in the documentation.

  • If the issue persists, you can refer to and use the examples in the SDK reference. For more information, see SDK Reference.

  • If you still cannot resolve the issue, you must provide the name of the request class that you called, the parameters that were used, the exception or returned message, and the sanitized code.

SMTP

  • If there is a returned message or exception

1. Check the corresponding error code.

  • If there is no returned message or exception

1. Confirm that you are using the correct Direct Mail region. Check whether the `host` matches the host of your Direct Mail region, whether the server is an Alibaba Cloud ECS instance, and whether the port is one of the allowed ports for Direct Mail.

2. Check whether the parameters are configured as described in the documentation and whether the parameter values match the settings in the console.

  • If the issue persists, you can refer to and use the code in the request example. For more information, see Java example for SMTP.

  • If you still cannot resolve the issue, you must provide the parameters that are used in the call, the exception or returned message, and the sanitized code.

Other methods

  • We do not provide technical support for issues that arise from using sending methods that are not described in the official documentation. You must resolve such issues on your own.

How to troubleshoot email content issues

First, determine which sending method you are using. Then, follow the corresponding suggestions.

API

For more information, see API overview.

  • For single sends, you can customize parameters and the email body. You must replace the parameters before you call the API. For more information, see SingleSendMail.

  • For batch sends, you must use a template and a recipient list. You can use the parameters that are provided in the documentation, but you cannot use custom parameters. For more information, see BatchSendMail.

SDK

For more information, see SDK Reference.

  • For single sends, you can customize parameters and the email body. You must replace the parameters before you call the API. For parameter descriptions, see the corresponding API documentation.

  • For batch sends, you must use a template and a recipient list. You can use the parameters that are provided in the documentation, but you cannot use custom parameters. For parameter descriptions, see the corresponding API documentation.

SMTP

For more information, see SMTP endpoints.

  • You can customize parameters and the email body. You must replace the parameters before you make the request.

Console

  • The console supports sending batch emails but not transactional emails. Attachments are not supported. You must select an uploaded recipient list, an approved template, a sender address, and an address type. You can use the parameters that are provided in the documentation within the template content, but you cannot use custom parameters. For more information, see Send emails from the console.

Other methods

  • We do not provide technical support for issues that arise from using sending methods that are not described in the official documentation. You must resolve such issues on your own.