The following example shows how to send an email through SMTP using PHP.
<?php
require 'email.class.php';
$mailto='***';
$mailsubject="Test mail";
$mailbody='Here is the mail content';
$smtpserver = "smtpdm.aliyun.com";
$smtpserverport = 25;
$smtpusermail = "***";
$smtpuser = "***";
$smtppass = "***";
$mailsubject = "=?UTF-8?B?" . base64_encode($mailsubject) . "?=";
$mailtype = "HTML";
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
$smtp->debug = false;
$smtp->sendmail($mailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
Note: email.class.php
is an external dependency which you must obtain by yourself.