<small id='8UXBc'></small><noframes id='8UXBc'>

    <bdo id='8UXBc'></bdo><ul id='8UXBc'></ul>
<i id='8UXBc'><tr id='8UXBc'><dt id='8UXBc'><q id='8UXBc'><span id='8UXBc'><b id='8UXBc'><form id='8UXBc'><ins id='8UXBc'></ins><ul id='8UXBc'></ul><sub id='8UXBc'></sub></form><legend id='8UXBc'></legend><bdo id='8UXBc'><pre id='8UXBc'><center id='8UXBc'></center></pre></bdo></b><th id='8UXBc'></th></span></q></dt></tr></i><div id='8UXBc'><tfoot id='8UXBc'></tfoot><dl id='8UXBc'><fieldset id='8UXBc'></fieldset></dl></div>
      <tfoot id='8UXBc'></tfoot><legend id='8UXBc'><style id='8UXBc'><dir id='8UXBc'><q id='8UXBc'></q></dir></style></legend>

        使用 Mule 发送格式化邮件

        时间:2023-06-28
            <bdo id='GAhG9'></bdo><ul id='GAhG9'></ul>
              <tbody id='GAhG9'></tbody>

            1. <legend id='GAhG9'><style id='GAhG9'><dir id='GAhG9'><q id='GAhG9'></q></dir></style></legend>
              <tfoot id='GAhG9'></tfoot>

              <small id='GAhG9'></small><noframes id='GAhG9'>

                1. <i id='GAhG9'><tr id='GAhG9'><dt id='GAhG9'><q id='GAhG9'><span id='GAhG9'><b id='GAhG9'><form id='GAhG9'><ins id='GAhG9'></ins><ul id='GAhG9'></ul><sub id='GAhG9'></sub></form><legend id='GAhG9'></legend><bdo id='GAhG9'><pre id='GAhG9'><center id='GAhG9'></center></pre></bdo></b><th id='GAhG9'></th></span></q></dt></tr></i><div id='GAhG9'><tfoot id='GAhG9'></tfoot><dl id='GAhG9'><fieldset id='GAhG9'></fieldset></dl></div>
                  本文介绍了使用 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?

                  这是我的流程的摘录:

                     <expression-transformer expression="#[com.generateText4Email(payload)]" doc:name="mailText"/>
                  <smtp:outbound-endpoint host="${smtp.host}"
                          responseTimeout="10000" doc:name="SMTP" connector-ref="smtpConnector"
                          from="${smtp.from}" port="${smtp.port}" subject="Invoice"
                          to="mail@mail.com" />
                  

                  我试过这个,但它不起作用.

                  I've tried with this but it doesn't work.

                  <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Email</title></head><body style="font-family:'Century Gothic'"><h1 style="text-align:center;"> company </h1><h2 style="font-size:14px;">Name : name <br />Company : arch <br />Email : qqq@aaaa.com</h2><p>fin</p></body></html>
                  

                  提前致谢.

                  推荐答案

                  我解决了.我错过了将 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:

                  <smtp:connector name="smtpConnector"
                      validateConnections="true" doc:name="SMTP" contentType="text/html"/>
                   <smtp:outbound-endpoint host="${smtp.host}"
                      responseTimeout="10000" doc:name="SMTP" connector-ref="smtpConnector"
                      from="${smtp.from}" port="${smtp.port}" subject="Invoice"
                      to="mail@mail.com"" mimeType="text/html"/>
                  

                  通过此配置,您可以像这样在文本中使用 html

                  With this configuration you can use html in your text like this

                  <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Email</title></head><body style="font-family:'Century Gothic'"><h1 style="text-align:center;"> company </h1><h2 style="font-size:14px;">Name : name <br />Company : arch <br />Email : qqq@aaaa.com</h2><p>fin</p></body></html>
                  

                  收到邮件时会显示.

                  希望对其他人有所帮助.

                  Hope it'll help someone else.

                  这篇关于使用 Mule 发送格式化邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  <small id='PJCpP'></small><noframes id='PJCpP'>

                  <i id='PJCpP'><tr id='PJCpP'><dt id='PJCpP'><q id='PJCpP'><span id='PJCpP'><b id='PJCpP'><form id='PJCpP'><ins id='PJCpP'></ins><ul id='PJCpP'></ul><sub id='PJCpP'></sub></form><legend id='PJCpP'></legend><bdo id='PJCpP'><pre id='PJCpP'><center id='PJCpP'></center></pre></bdo></b><th id='PJCpP'></th></span></q></dt></tr></i><div id='PJCpP'><tfoot id='PJCpP'></tfoot><dl id='PJCpP'><fieldset id='PJCpP'></fieldset></dl></div>
                    <legend id='PJCpP'><style id='PJCpP'><dir id='PJCpP'><q id='PJCpP'></q></dir></style></legend>
                    • <bdo id='PJCpP'></bdo><ul id='PJCpP'></ul>
                    • <tfoot id='PJCpP'></tfoot>
                            <tbody id='PJCpP'></tbody>