使用 Mule ESB 通过 smtp header 发送名称
Send name trough smtp header with Mule ESB
我们正在使用 Mule ESB 通过 smtp:connector 和 smtp:endpoint 发送电子邮件。我以前从来没有和骡子一起工作过。任务是通过 smtp header FROM 字段发送一个人的名字,这样这个人的名字就会掩盖我们发送的通用电子邮件,基本上是 "My Name" 。我已经用 mule 尝试过这种确切的格式,但它会抛出一些格式错误的异常。我知道用 java 可以做到这一点,但似乎无法在 mule xml 文件中找到 属性。也许可以劫持 smtp:endpoint 并编写自定义 java 代码来执行此操作?
ps。我不允许给你任何代码:(
尝试在 SMTP 出站端点的 from 属性中传递 MEL 表达式,如下所示:
<smtp:outbound-endpoint from="#[message.inboundProperties['smtp.from']]" host="..." port="..." connector-ref="..." to="#[message.inboundProperties['smtp.to']]" subject="#[message.inboundProperties['smtp.subject']]" cc="#[message.inboundProperties['smtp.cc']]" bcc="#[message.inboundProperties['smtp.bcc']]" responseTimeout="10000" doc:name="Send SMTP"></smtp:outbound-endpoint>
我们正在使用 Mule ESB 通过 smtp:connector 和 smtp:endpoint 发送电子邮件。我以前从来没有和骡子一起工作过。任务是通过 smtp header FROM 字段发送一个人的名字,这样这个人的名字就会掩盖我们发送的通用电子邮件,基本上是 "My Name" 。我已经用 mule 尝试过这种确切的格式,但它会抛出一些格式错误的异常。我知道用 java 可以做到这一点,但似乎无法在 mule xml 文件中找到 属性。也许可以劫持 smtp:endpoint 并编写自定义 java 代码来执行此操作?
ps。我不允许给你任何代码:(
尝试在 SMTP 出站端点的 from 属性中传递 MEL 表达式,如下所示:
<smtp:outbound-endpoint from="#[message.inboundProperties['smtp.from']]" host="..." port="..." connector-ref="..." to="#[message.inboundProperties['smtp.to']]" subject="#[message.inboundProperties['smtp.subject']]" cc="#[message.inboundProperties['smtp.cc']]" bcc="#[message.inboundProperties['smtp.bcc']]" responseTimeout="10000" doc:name="Send SMTP"></smtp:outbound-endpoint>