问题描述
我正在尝试使用Mule 3.3.0并配置SMTP端点.该流可以具有文件入站端点和SMTP出站端点.另一个流程可以具有一个Java类,该类生成String内容(电子邮件的正文),并创建一个CSV文件,它将尝试将其推送到SMTP出站端点.
I am trying to use Mule 3.3.0 and configure an SMTP Endpoint.The flow can have a File Inbound Endpoint and a SMTP outbound endpoint.Another flow can have a Java class that generates a String content (body of the email) and also creates a CSV file that it will try to push to the SMTP Outbound Endpoint.
不幸的是,似乎Mule SMTP通过简单的配置不支持现成的附件.我在网上阅读,似乎做到这一点的一种方法是编写自己的转换器.能够通过电子邮件发送附件是一个非常基本的功能,如果可以通过简单的配置实现此功能,我希望能收到Mule专家的答复.
Unforutnately it doesn't seem Mule SMTP supports attachment out of the box by simple configuration. I read up in the web and seems one way to do it is write your own transformer. TO be able to send an attachment with an email is quite a basic feature and I am looking forward to hear answers from Mule experts if this is possible by simple configs.
推荐答案
可以通过两种方式完成.
It can be done in two ways.
具有Mule配置的一个
One with Mule configuration
<set-attachment attachmentName="" value="" contentType="" />
第二个是Mule API.
Second with Mule API.
org.mule.api.MuleMessage.addOutboundAttachment(String arg0, Object arg1, String arg2)
或
org.mule.api.MuleMessage.addOutboundAttachment(String arg0, DataHandler arg1)
希望这会有所帮助.
这篇关于Mule SMTP-发送带有附件的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!