问题
Need help: how to send emails with inline image?
The response returns 200 OK but email is not being sent. But when I removed $message->embed() everything is alright.
I used {{ $message->embed('img/logo.png') }} in the view file, but the email is not sending, is it wrong location of image? (i have triedputting logo.png in public/img dir and app/views/emails/img dir, my email view file is in app/views/emails/mail.blade.php).Or is it something else?
回答1:
for Embeding an image try this:
<img width="250px" src="{{ $message->embed(public_path('img/logo.png')) }}" alt="logo">
remember that folder img must be in public.
回答2:
Try using URL::asset('img/logo.png')
instead of the direct path and always put your static files in public folder
.
来源:https://stackoverflow.com/questions/24464413/laravel-4-cannot-send-email-with-inline-embedding