symfony - Symfony 5 Mailer 发送带有个人资料图片的邮件
问题描述
所以我正在尝试使用我的提供商的 smtp 服务器从 symfony 发送电子邮件。
一切正常。但现在我要做的是在发送电子邮件中将我的个人资料图片显示为头像(而不是那个头像)
我正在使用基本的邮件程序 sendEMail() 功能:
$message = (new \Swift_Message('Hello Email'))
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody(
$this->renderView(
// templates/emails/registration.html.twig
'emails/registration.html.twig',
['name' => $name]
),
'text/html'
);
// you can remove the following code if you don't define a text version for your emails
$mailer->send($message);
提前致谢。
解决方案
推荐阅读
- kubernetes - 转义 helm yml 进行部署
- django - 如何根据外键的主键上传文件?
- android - 如何在 AR 中将 3D 模型放置在屏幕中心,并相对于轴上的摄像机角度将其移动近或远?
- c# - LINQ如何在where子句中将方法变量作为列名传递
- java - 在初始化期间在 H2 数据库中设置别名
- ruby - ruby 代码中的这种代码注释样式是什么
- php - 无法 php artisan 迁移 - Laravel
- laravel - 在 Laravel 的左连接中获取结果计数
- javascript - 如何使用 Tizen Web studio 在我的应用程序中使用下载的 svg 文件?
- html - 当 iframe 高度可变时嵌入 iframe