This is my excel file in public folder. Heres the directory structure
The file name is user_products.xlsx. I need to send it as an attachment. Here is the mail class's build function
public function build()
{
// dd($this->data);
return $this->subject('Subject:User Cart Inquiry')->view('emails.sendUserSubmitMail')
->attach(public_path('user_products.xlsx'), [
'as' => 'user products.xlsx',
'mime' => 'application/xlsx',
])
->with('data', $this->data);
}
The mail is working fine, but when i added the ->attach(), its showing error.
The error is
message: "Unable to open file for reading [/opt/lampp/htdocs/RC/public/user_products.xlsx]"
Please help. Thank You!
