Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用无Html标记的ckeditor发送电子邮件_Php_Symfony_Ckeditor_Symfony Forms_Swiftmailer - Fatal编程技术网

Php 如何使用无Html标记的ckeditor发送电子邮件

Php 如何使用无Html标记的ckeditor发送电子邮件,php,symfony,ckeditor,symfony-forms,swiftmailer,Php,Symfony,Ckeditor,Symfony Forms,Swiftmailer,我已将ckeditor集成到我的项目symfony中,用于发送电子邮件 我在FormBuilder中添加了这个 ->add('message', CKEditorType::class) 编辑它的工作,我看到工具栏 但是当我发送电子邮件时,我会收到这样的信息示例 <p>Hello,</p> <p><strong> This is an example</strong></p> 你好 这是一个例子 我的问题是我不知

我已将ckeditor集成到我的项目symfony中,用于发送电子邮件

我在FormBuilder中添加了这个

->add('message', CKEditorType::class)
编辑它的工作,我看到工具栏 但是当我发送电子邮件时,我会收到这样的信息示例

<p>Hello,</p>
<p><strong> This is an example</strong></p>
你好

这是一个例子

我的问题是我不知道用什么来接收带有html标记的消息,我希望像这样接收它

你好 这是一个例子


您可以使用细枝原始过滤器,因此在其渲染的模板中使用:

{{ message|raw }}
这将使您的CKEditor标记像strong一样


您可以阅读更多信息。

看起来您正在以纯文本电子邮件的形式发送HTML文本。您应该将其作为HTML电子邮件发送。这对您有意义吗?@KIKOSoftware谢谢,我已将邮件添加为html:->setBody($message,'text/html')显示您发送电子邮件的位置这是正确答案,但请确保电子邮件内容来自可信用户。如果内容由不受信任的用户提供,这可能会导致许多安全问题。