简体   繁体   English

如何使用发送中介 WSO2 向多个电子邮件地址发送电子邮件

[英]How to send an email to multiple email addresses with the send mediator WSO2

I have created a file transfer service that sends files from one locations to another and when those files successfully transfer, it sends out an email to notify the receiver that the files are in their directory.我创建了一个文件传输服务,可以将文件从一个位置发送到另一个位置,当这些文件成功传输时,它会发送一封电子邮件通知接收者文件在他们的目录中。 I have it currently working with one email, however I need the email notification to be sent to multiple email addresses.我目前使用一封电子邮件,但我需要将电子邮件通知发送到多个电子邮件地址。 I was using the address endpoint to achieve the signal email being sent out.我正在使用地址端点来实现发送信号电子邮件。 I have implemented a couple of ways to send an email to multiple endpoints but none of them worked.我已经实现了几种向多个端点发送电子邮件的方法,但没有一种有效。

I have tried to implement the recipient list endpoint however after doing some research it seems that it currently does not work on integration studio and throws an error every time i add it to the design.我曾尝试实施收件人列表端点,但在进行一些研究后,它似乎目前不适用于集成工作室,并且每次我将其添加到设计中时都会抛出错误。 I can not use the loadbalance endpoint or the failover endpoint as it sends an email to the first endpoint only and I have tried to make a copy of the default MailTo sender configuration in the <EI_HOME>/conf/axis2/axis2.xml file and change the transport sender name.我无法使用负载平衡端点或故障转移端点,因为它仅向第一个端点发送电子邮件,并且我已尝试在 <EI_HOME>/conf/axis2/axis2.xml 文件中制作默认 MailTo 发件人配置的副本,并且更改传输发件人名称。 For example, add mailtoWSO2 as the name.例如,添加 mailtoWSO2 作为名称。

 <transportSender name="mailtoWSO2" class="org.apache.axis2.transport.mail.MailTransportSender">

And I added the endpoint to the syntax however in which ever way I added it, it automatically gets removed.我将端点添加到语法中,但是无论我以何种方式添加它,它都会自动被删除。 If there is a way around this, any assistance is greatly appreciated.如果有办法解决这个问题,我们将不胜感激任何帮助。

If you have proper configuration for MailTransportSender , you use comma to separate recipients.如果您对MailTransportSender进行了正确配置,则可以使用逗号分隔收件人。 For you case it should be something like below:对于您的情况,它应该类似于以下内容:

<send>
   <endpoint>
      <address uri="mailtoWSO2:one@mail.com,second@mail.com" />
   </endpoint>
</send>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM