Chron's avatar
Level 7

image not showing in email

I have this in resources/views/vendor/mail/html/header.blade.php

<tr>
    <td class="header">
        <a href="{{ $url }}">
            <img src="{{ asset('/photos/icon.png') }}"/>
        </a>
    </td>
</tr>

When the email was sent, the image is just broken but it shows the image when I click the source localhost:8000/photos/icon.png

0 likes
7 replies
bugsysha's avatar

Try using service like mailtrap.io to debug this.

1 like
Chron's avatar
Level 7

Hmm, weird. I just tried it in mailtrap and it showed the images.

thinkverse's avatar

localhost:8000 will only show the image for you since it's well, local. You can set the URL the asset function will use in your environment file under ASSET_URL.

It's explained in the documentation under /helpers#method-asset.

Hope that helps. 🙂

Chron's avatar
Level 7

Huh, it's showing in mailtrap but not in gmail.

thinkverse's avatar

Gmail could have a restriction on localhost URLs, most likely through a content policy of some kind.

Please or to participate in this conversation.