You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to send attachments with e-mail, but are not being sended.
The email never comes, it's just to test.
If attachments are not send, the email arrives
Here is my code in App\Mail\OrderShipped.
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use function GuzzleHttp\Psr7\mimetype_from_filename;
class OrderShipped extends Mailable
{
use Queueable, SerializesModels;
protected $config;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($config)
{
$this->config = $config;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$attachments = json_decode($this->config['attachments']);
return $this->view('welcome')
->attach($attachments[0]->path, [
'as' => $attachments[0]->name,
'mime' => mimetype_from_filename($attachments[0]->path)
]);
}
}
Thanks.
The text was updated successfully, but these errors were encountered:
Hello.
I'm trying to send attachments with e-mail, but are not being sended.
The email never comes, it's just to test.
If attachments are not send, the email arrives
Here is my code in App\Mail\OrderShipped.
Thanks.
The text was updated successfully, but these errors were encountered: