【问题标题】:WSO2 EI Send Email as Attachment From base64 StringWSO2 EI 从 base64 字符串作为附件发送电子邮件
【发布时间】:2020-03-13 09:27:21
【问题描述】:

我正在使用 WSO2 EI 6.5.0 发送带有附件的电子邮件。当附件以base64字符串存储在数据库中时,是否可以发送带有附件的HTML电子邮件?截至目前,我尝试发送电子邮件,但电子邮件以纯文本形式收到。

我的流程应该是:

Proxy service > Get base64 string from database sequence > Send email sequence.

我试图查找参考资料,但没有找到关于我的问题的参考资料。

以下是发送邮件序列

的源代码
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="SendMailSequence">
    <log level="full">
        <property name="sequence" value="sendMailSequence" />
    </log>
    <payloadFactory media-type="xml">
        <format>
            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                <soapenv:Body>
                    <ns:binary xmlns:ns="http://ws.apache.org/commons/ns/payload">$1</ns:binary>
                </soapenv:Body>
            </soapenv:Envelope>
        </format>
        <args>
            <!-- messageBody is from database -->
            <arg expression="$ctx:messageBody" />
        </args>
    </payloadFactory>
    <property name="messageType" value="application/octet-stream" scope="axis2" />
    <property name="Subject" value="File Received" scope="transport" />
    <property name="OUT_ONLY" value="true" />
    <send>
        <endpoint name="FileEpr">
            <address uri="mailto:my-email@gmail.com" />
        </endpoint>
    </send>
</sequence>

【问题讨论】:

  • 你找到解决办法了吗?

标签: email wso2 wso2esb attachment wso2ei


【解决方案1】:

您将 messageType 设置为 application/octet-stream 有什么原因吗?如果您设置了正确的 messageBuilder,它应该可以正常工作。看看下面的链接。 http://sachirajapakse.blogspot.com/2016/06/sending-mails-with-attachments-via-wso2.html Why WSO2 ESB is Encoding Email Attachment in Base64

【讨论】:

  • 不幸的是,这些都不能帮助理解问题。我自己试过了,没有一个适合我。
猜你喜欢
  • 1970-01-01
  • 2019-05-04
  • 1970-01-01
  • 1970-01-01
  • 2017-08-14
  • 2023-03-23
  • 1970-01-01
  • 1970-01-01
  • 2022-11-14
相关资源
最近更新 更多