PHP code example of draguo / directmail
1. Go to this page and download the library: Download draguo/directmail library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
draguo / directmail example snippets
$body = "<h1>这是标题</h1>";
$mail = new \Draguo\DirectMail\DirectMail($accessKey, $secret);
$result = $mail->send([
'from' => '', // 发信地址 AccountName
'to' => '', // 多个地址可用逗号分隔,最多100个
'name' => '', // 发件人昵称 FromAlias
'subject' => '这个是邮件的主题', // Subject
'body' => $body, // html or text
'trace' => '' // 是否开启数据追踪功能, 1 或 0
]);
echo $result;