我在邮件模板上有图像但是当我发送它时不带图像.我该怎么办.
模板HTML
<img src="/img/blahblah.jpg"> //this image does not display on receiver of mail
Run Code Online (Sandbox Code Playgroud)
软件\邮件\订阅
public function build() {
return $this->view('mail.subscribe');
}
Run Code Online (Sandbox Code Playgroud)
要嵌入内嵌图像,请在电子邮件模板中的$ message变量上使用embed方法.Laravel会自动为所有电子邮件模板提供$ message变量,因此您无需担心手动传递它
<img src="{{ $message->embed($pathToFile) }}">
Run Code Online (Sandbox Code Playgroud)
https://laravel.com/docs/5.3/mail#inline-attachments
| 归档时间: |
|
| 查看次数: |
2586 次 |
| 最近记录: |