0

I am following this tutorial to enable the MailTransportSender and MailTransportListener. I manage to send an email to the DevNullSMTP, SMTP Server.

My question now is. How to add CC and BCC receipient ?

I try with the following at the Endpoint URL but still no luck:

<send>
  <endpoint name="MailEpr">
        <address uri="mailto:username@gmail.com? 
        cc=someone@gmail.com,tester@gmail.com&amp;bcc=tolala@gmail.com"/>
  </endpoint>

Please teach me master !

ameruddin jamil
  • 155
  • 4
  • 18

3 Answers3

1

Please try the below sample.

<sequence name="MailSendingSequence" xmlns="http://ws.apache.org/ns/synapse">
<property name="Subject" scope="transport" value="The Sample Subject"/>
<property name="Cc" scope="transport" value="mail@gmail.com"/>
<property name="Bcc" scope="transport" value="mail@gmail.com"/>
<payloadFactory media-type="xml">
    <format>
        <message>Email Body</message>
    </format>
</payloadFactory>
<header name="To" scope="default" value="mailto:mail@gmail.com"/>
<property name="messageType" scope="axis2" value="text/plain"/>
<send/>

The additional properties can be found in [1].

[1]. https://github.com/wso2/wso2-axis2-transports/blob/474118af45413b049a1aae4ba747fee15de5133d/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailConstants.java#L88

Methma
  • 152
  • 3
  • 13
0

Haven't tried it, but according to the documentation this pseydo code should work.

<property name="Cc" value="foo@example.com,bar@example.com" scope="transport" type="STRING"/>

<property name="Bcc" value="bccfoo@example.com,bccbar@example.com" scope="transport" type="STRING"/>

<property name="Subject" value="Custom Subject for Response" scope="transport"/>
<header name="To" expression="fn:concat('mailto:', get-property('senderAddress'))"/>

<send/>
Martin Hald
  • 676
  • 4
  • 11
-1

Can you please try to use Property with scope as transport before send mediator like below

<property name="Cc" value="Ccuser1@gmail.com, Ccuser2@gmail.com" scope="transport" type="STRING"/>  
<property name="Bcc" value="Bccuser1@gmail.com, Bccuser2@gmail.com" scope="transport" type="STRING"/> 

For more info click here

Justin
  • 855
  • 2
  • 11
  • 30