使用WSO2 EI发送电子邮件

时间:2019-01-24 10:24:19

标签: wso2 ei

我使用WSO2 EI发送电子邮件,但在下面收到错误消息。

  

2019-01-24 17:53:12,353若要:   /services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint,WSAction:   urn:mediate,SOAPAction:urn:mediate,MessageID:   urn:uuid:06891289-318c-49b1-83bd-bc71c7590078,方向:要求,   MESSAGE =执行默认的“故障”序列,ERROR_CODE = 0,   ERROR_MESSAGE =发送消息时出现意外错误,信封:   你好   WSO2 .....!
        2019-01-24 17:53:12,347挂起端点:地址为mailto:zoehuang@asqimacau.com的AnonymousEndpoint-当前挂起持续时间   是:30000ms-下一次重试时间:2019年1月24日星期四17:53:42
        2019-01-24 17:53:12,347端点:地址为mailto:zoehuang@asqimacau.com的AnonymousEndpoint会因为失败而被标记为已暂停
        2019-01-24 17:53:12,308发送消息期间发生意外错误         2019-01-24 17:53:12,302生成邮件消息时出错
        2019-01-24 17:53:12,284创建电子邮件消息或将其发送到配置的服务器时出错
        2019-01-24 17:51:26,988无法将ViaPost发送到url [http://asqi-vm:8280/services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint]
        2019-01-24 17:50:27,008此引擎将使GLOBAL_TIMEOUT之后的所有回调失效:1200秒,无论超时如何   指定的或可选的超时后采取的操作
        2019-01-24 17:50:26,990至:/services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint,WSAction:   urn:mediate,SOAPAction:urn:mediate,MessageID:   urn:uuid:06891289-318c-49b1-83bd-bc71c7590078,方向:要求,   信封:你好   WSO2 .....!

EI_HOME \ conf \ axis2 \ axis2.xml中的配置文件设置

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.host">xxxx-mail1.com</parameter>
        <parameter name="mail.smtp.port">465</parameter>
        <parameter name="mail.smtp.starttls.enable">true</parameter>
        <parameter name="mail.smtp.auth">true</parameter>
        <parameter name="mail.smtp.user">xxxxx@xxxxx.com</parameter>
        <parameter name="mail.smtp.password">password</parameter>
        <parameter name="mail.smtp.from">xxxxx@xxxxx.com</parameter>
</transportSender>

我在EI中的代理服务代码

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="SimpleProxy2"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target>
      <inSequence>
         <property name="messageType"
                   scope="axis2"
                   type="STRING"
                   value="text/html"/>
         <property name="ContentType" scope="axis2" value="text/html"/>
         <property name="Subject" scope="transport" value="Testing ESB"/>
         <property name="OUT_ONLY" value="true"/>
         <property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
         <payloadFactory media-type="xml">
            <format>
               <ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">$1</ns:text>
            </format>
            <args>
               <arg value="Hello WSO2.....!"/>
            </args>
         </payloadFactory>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="mailto:xxxxx@xxxxx.com"/>
            </endpoint>
         </send>
         <log level="full"/>
      </inSequence>
      <outSequence>
      </outSequence>
   </target>
   <description/>
</proxy>

我希望我可以使用WSO2 EI发送电子邮件和接收电子邮件。

1 个答案:

答案 0 :(得分:1)

如果您可以参考[1]中的文档,我们可以观察到以下示例邮件传输配置

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
    <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
    <parameter name="mail.smtp.port">587</parameter>
    <parameter name="mail.smtp.starttls.enable">true</parameter>
    <parameter name="mail.smtp.auth">true</parameter>
    <parameter name="mail.smtp.user">synapse.demo.0</parameter>
    <parameter name="mail.smtp.password">mailpassword</parameter>
    <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
</transportSender>

请在您的配置中参考以下参数。在下面的内容中,您可以将smtp.user值修改为xxxxx(以上为synapse.demo.0),而不是xxxxx@xxxxx.com

<parameter name="mail.smtp.user">xxxxx@xxxxx.com</parameter>
 <parameter name="mail.smtp.from">xxxxx@xxxxx.com</parameter>

[1]-https://docs.wso2.com/display/EI640/MailTo+Transport