我在下面使用了一个简单的 Laravel Mailable,并在电子邮件顶部显示了标题图像 - 通过 Mailtrap.io 时显示正常,但是当在实时环境中将相同的电子邮件发送到我的 Gmail 帐户时,它不会显示- 我究竟做错了什么?
class TwoFactorMail extends Mailable
{
use Queueable, SerializesModels;
public $code;
public function __construct($code)
{
$this->code = $code;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->markdown('emails.twofactor');
}
}
刀片文件
@component('mail::message')
<html>
<head>
<title>Two Factor</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins|Roboto&display=swap" rel="stylesheet">
</head>
<body>
<img src="data:image/png;base64,{{base64_encode(file_get_contents(resource_path('img/header.jpg')))}}" alt="">
<h1 class="header padded-margin">Authentication code</h1><hr class="divider">
<p>Your Two-Factor Authentication is below. Add the code into your browser to complete your CrowdControlHQ Sign In.</p>
<div class="code padded-margin">{{ $code }}</div>
<p>If you didn’t request this code there is nothing to worry about - you can safely ignore it.</p>
</body>
</html>
@endcomponent