Sending formatted mails with Mule(使用 Mule 发送格式化邮件)
问题描述
我正在使用 Mule 发送电子邮件.我需要为我发送的文本添加格式.邮件的内容是有效负载,其中包含我在 Java 方法中形成的字符串,并使用表达式转换器发送到流.我需要为该字符串添加格式:粗体、下划线、颜色......我该怎么做?
I'm sending emails using Mule. I need to add format to the text I send. The content of the mail is the payload which has a String in it that I form in a Java method and send to the flow with an Expression transformer. I need to add format to that String: bold, underline, colour.... How can I do it?
这是我的流程的摘录:
我试过这个,但它不起作用.
I've tried with this but it doesn't work.
提前致谢.
推荐答案
我解决了.我错过了将 smtp:connector 中的 content-type 和 smtp:outbpund-endbound 中的 mime-type 设置为 text/html 才能正常工作.这是正确的代码:
I solved it. I was missing setting content-type in the smtp:connector and the mime-type in the smtp:outbpund-endbound as text/html for the to work. This is the correct code:
通过此配置,您可以像这样在文本中使用 html
With this configuration you can use html in your text like this
收到邮件时会显示.
希望对其他人有所帮助.
Hope it'll help someone else.
这篇关于使用 Mule 发送格式化邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!