1
我有角應用作爲前端和laravel 5.2作爲api後端。我的角應用程序發送參數到我的laravel控制器這樣的:如何將文件附加到Laravel 5.2郵件Base64格式
{
name: "My Name",
email: "[email protected]",
subject: "Hello",
message: "This My Message",
attachment: {
base64: /9j/4AAQSkZJRgABAQEASABIAAD/2wCEAAMCAgMC.....
filetype: "application/rar",
filename: "example.rar",
filesize: 198141,…
}
}
在我laravel控制器我有這樣的代碼
$data = [
'name' => $request->input('name'),
'email' => $request->input('email'),
'subject' => $request->input('subject'),
'message' => $request->input('message'),
'attachment' => $request->file('attachment'),
'store' => 'Store Name',
];
Mail::send('emails.call-us', ['data' => $data],
function ($m) use ($data) {
$m->from($data['email'], $data['name'] . ' - ' . $data['store']);
$m->attach($data['attachment'], [as => 'example.rar', ['mime' => 'application/rar']);
$m->to(env('EMAIL_CONTACT_US'));
$m->subject($data['subject']);
});
什麼是發送文件從Base64格式附件的電子郵件推薦的方法是什麼?由於