How to Send Emails Using DirectMail

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”
Image for post

b. Click on “New Domain”

Image for post

c. Type in your domain

Image for post

d. Click on “Configure”

Image for post

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

Image for post

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

Image for post

g. Verify the domain

Image for post

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

Image for post

Setup the SMTP password for the domain

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

Image for post

b. Choose “Products” -> “DirectMail”

Image for post

c. Choose “ModifyPWByDomain”

Image for post

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

Image for post

e. A return code will be displayed

Image for post

Setup sender address in the DM console

a. Create Sender Address

Image for post

b. Add the test email sender

Image for post
Image for post

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

Image for post

c. Test result

Image for post

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

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store