Send email through Direct Mail's SMTP service using Swaks, a Perl-based command-line SMTP testing tool.
Prerequisites
Before you begin, ensure that you have:
A verified sender address in Direct Mail
The SMTP password for your sender address
A Debian/Ubuntu system with
curlandsudoaccess
Send an email
Swaks (Swiss Army Knife for SMTP) is a Perl-based command-line tool for testing SMTP. The steps below install Swaks and use it to send an email over Direct Mail's SMTP service.
Download Swaks.
curl http://www.jetmore.org/john/code/swaks/files/swaks-20130209.0/swaks -o swaks
Make the script executable.
chmod +x swaks
Install Perl.
sudo apt-get -y install perl
-
Send an email. Replace the placeholder values before running the command.
./swaks --auth \ --server smtpdm.aliyun.com \ --au <sender-address> \ --ap <smtp-password> \ --from <sender-address> \ --to <recipient-address> \ --h-Subject: "Hello" \ --body 'Testing mail!'
Replace the following placeholders:
<sender-address>after--au: your verified sender address in Direct Mail.<smtp-password>after--ap: the SMTP password for your sender address.<sender-address>after--from: the sender address (same as--au).<recipient-address>after--to: the recipient's email address.