在app\Mail下建立SendMail class:
$php artisan make:mail SendEmail
使用方式:
xxx.blade.php:
.env中記得mail config (以gmail為例):
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=xxx@gmail.com
MAIL_PASSWORD=*
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=xxx@gmail.com
MAIL_FROM_NAME="${APP_NAME}"