I got image on mail template but when i send it does not carry the image. what should i do.
Template HTML
<img src="/img/blahblah.jpg"> //this image does not display on receiver of mail
App\Mail\Subscribe
public function build() {
return $this->view('mail.subscribe');
}
To embed an inline image, use the embed method on the $message variable within your email template. Laravel automatically makes the $message variable available to all of your email templates, so you don't need to worry about passing it in manually
<img src="{{ $message->embed($pathToFile) }}">
https://laravel.com/docs/5.3/mail#inline-attachments
In your mail template use the asset
helper function to get the full url of the image as:
<img src="{{ asset('img/blahblah.jpg') }}">
From docs
Generate a URL for an
asset
using the current scheme of the request (HTTP or HTTPS)
Check out the docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With