[英]phpmailer not sending email to gmail,yahoo,hotmail or these are blocking email sent by phpmailer
[英]Change default laravel email template theme sent to gmail or hotmail
这是 laravel 使用 smtp 生成和发送的默认电子邮件,我想更改此默认模板,例如添加一些图片、url...我该怎么做? 谢谢
运行php artisan vendor:publish
并导航到resources/views/vendor/notifications
然后现在你有两个文件,编辑它们。
在这里,我只展示了如何从邮件模板中更改默认的 Laravel 徽标
第一步是在我们的资源文件夹中发布我们的邮件组件,以便我们可以更改默认配置。
运行以下命令。
php artisan vendor:publish --tag=laravel-mail
现在这个命令将在你的 app/resources/views 目录中创建一个 vendor 文件夹。
现在您可以在邮件模板中提供您的图像路径以在邮件上使用您的自定义图像,如下面的代码所示
@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
{{-- {{ config('app.name') }} --}}
<img src="{{asset('storage/logo/logo.jpg')}}" style="height: 75px;width: 75px;">
@endcomponent
@endslot
{{-- Body --}}
{{ $slot }}
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
@endcomponent
@endslot
@endcomponent
有关更多信息,您可以访问这里
使用make:auth
生成make:auth
,它将在resources/view/auth
文件夹中生成所需的视图。
您可以根据需要自定义resources/views/auth/emails/password.blade.php
页面。 您可以按要求添加图片和网址
有关更多详细信息,请参阅文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.