tp5發送email功能: PHPmailer
第一步:使用composer安裝phpmailer
- composer require phpmailer/phpmailer
第二步:common.php寫個發送郵件的函數
/** * 系統郵件發送函數 * @param string $tomail 接收郵件者郵箱 * @param string $name 接收郵件者名稱 * @param string $subject 郵件主題 * @param string $body 郵件內容 * @param string $attachment 附件列表 * @return boolean * @author static7 <[email protected]