gpt4 book ai didi

laravel - 如何使用Mail Facade在laravel 5.3上附加图像电子邮件?

转载 作者:行者123 更新时间:2023-12-04 17:16:26 25 4
gpt4 key购买 nike

我在邮件模板上得到了图像,但是当我发送它时没有图像。我该怎么办。

模板 HTML

<img src="/img/blahblah.jpg"> //this image does not display on receiver of mail

应用\邮件\订阅
public function build() {
return $this->view('mail.subscribe');
}

最佳答案

To embed an inline image, use the embed method on the $message variable within your email template. Laravel automatically makes the $message variable available to all of your email templates, so you don't need to worry about passing it in manually


<img src="{{ $message->embed($pathToFile) }}">

https://laravel.com/docs/5.3/mail#inline-attachments

关于laravel - 如何使用Mail Facade在laravel 5.3上附加图像电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41166010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com