use Illuminate\Support\Facades\Mail;
use Qiniu\Auth;
private static function sendPdfEmailAnnex($path, $user) { $auth = new Auth(env('QINIU_ACCESS_KEY'), env('QINIU_SECRET_KEY')); $expiry = 3600; // 有效期,单位:秒 $downloadUrl = $auth->privateDownloadUrl($path, $expiry); $PdfEmail = new App\Mail\PdfEmail($user, $downloadUrl); # $downloadUrl 这个参数发送到视图层去
$build = $PdfEmail->build(); Mail::to($user)->send($build); }
<!DOCTYPE html> <html> <head> <title>html 自己随便编辑按照自己的要求格式</title> </head> <body> <p>请点击以下链接下载文件:</p> <a href="{{ $path }}">Download</a> </body> </html>
标签:laravel,downloadUrl,七牛,build,PdfEmail,Mail,email,user From: https://www.cnblogs.com/G921123/p/18027620