How to Send Emails Using DirectMail

Alibaba Cloud
3 min readMar 13, 2019

--

By Oliver Zhang, Solutions Architect — Alibaba Cloud ANZ

DirectMail is a simple and efficient service to send email notifications and batch email quickly and efficiently without the need to build your own email server. DirectMail is a key product for serving Alibaba’s own e-commerce platforms, which includes servicing Alibaba’s record-breaking Double 11 annual shopping festival.

In this article, we are going to discuss how to use Alibaba Cloud DirectMail (DM) service to send emails. It’s actually quite easy to setup the email domain and sender on the DM console, and then using telnet to test it.

Prerequisites

  1. An Alibaba Cloud account
  2. A test domain with access to change DNS records
  3. An email inbox for testing
  4. Add your email domain into DM.
  5. a. Click on “Email Domains”

b. Click on “New Domain”

c. Type in your domain

d. Click on “Configure”

e. On the configure page, these are the records need to be added into the domain DNS.

f. Go to your domain service provider and add the records.

g. Verify the domain

h. If your DNS records were setup correctly, the domain shall pass the verification.

Setup the SMTP password for the domain

a. Go to “https://api.aliyun.com/?#/"

b. Choose “Products” -> “DirectMail”

c. Choose “ModifyPWByDomain”

d. Select the region you have setup domain and type in the domain name and password, then “Submit Request”

e. A return code will be displayed

Setup sender address in the DM console

a. Create Sender Address

b. Add the test email sender

Test email with telnet

a. Telnet script

  • telnet smtpdm-ap-southeast-2.aliyun.com 25 HELO alibabacloudanz.com AUTH LOGIN <domain alibabacloudanz.com converted to base64 code> <domain password converted to base64 code> MAIL FROM:<bobthebuilder@alibabacloudanz.com> RCPT TO: <oliver.zhang@alibaba-inc.com> DATA subject: test email title from: <bobthebulder@alibabacloudanz.com> to: <oliver.zhang@alibaba-inc.com> test email body . quit

b. Example

c. Test result

Reference:https://www.alibabacloud.com/blog/how-to-send-emails-using-directmail_594537?spm=a2c41.12636457.0.0

--

--

Alibaba Cloud
Alibaba Cloud

Written by Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

No responses yet