我的代碼發送電子郵件這樣的:像這樣如何在laravel的電子郵件佈局中顯示圖像?
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Test')
->markdown('vendor.mail.markdown.message', ['data' => $this->data]);
}
我message.blade觀點:
@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
{{ config('app.name') }}
@endcomponent
@endslot
{{-- Body --}}
This is your logo
![Some option text][logo]
[logo]: {{asset('img/my-logo.png')}} "Logo"
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
@endcomponent
@endslot
@endcomponent
它成功發送電子郵件,但包含電子郵件的是這樣的:
This is your logo
![Some option text][logo]
[logo]: http://myshop.dev/img/my-logo.png "Logo"
圖片不顯示
我該如何解決這個問題?
Laravel文件表明,它不具有圖像的電子郵件組件。你很可能必須自己做。 –
@Stuart Murphy,你是什麼意思?試着更詳細地回答 –
你是從本地發送電子郵件嗎? –