cancel
Showing results for 
Search instead for 
Did you mean: 

How to send mails to "CC" and "BCC" using receiver mail adapter dynamically

Former Member
0 Kudos

Hi,

Due to business requirement PI need to send mails dynamically to u201CCCu201D and u201CBCCu201D using receiver mail adapter.

We have an option to send mails to u201CTou201D dynamically, but are there any option to send mails u201CCCu201D and u201CBCCu201D dynamically.

Please some help to resolve the issue. Thanks

Regards,

Sreeramulu Konjeti.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Check the ASMA properties of the Mail adapter.

For your requirement, you would need to populate the attributes THeaderBCC and SHeaderCC.

Regards

Former Member
0 Kudos

Hi Aditya,

can you please describe THeaderBCC and SHeaderCC more.

If i use these fields names in Target structure, Mail adapter will recognize as BCC and CC.

Can you please give some more input on this. Thanks

Regards,

Sreeramulu Konjeti.

Former Member
0 Kudos

Hi Sreeramulu,

In additon to what Shiladitya mentioned above, please set the attributes "THeaderBCC" and "THeaderCC" with the values that needs to be populated via mapping . These attributes can be set using Dynamic Configuration in mapping and remember to use the namespace: "http://sap.com/xi/XI/System/Mail" which is used for Mail Adapter attributes.

And then you can use the ASMA properties from the advanced tab of the Receiver Mail Adapter/channel which will enable to carry the dynamic values set for CC & BCC fields.

Hope this helps.

Regards, Gaurav.

Former Member
0 Kudos

Yes, mail adapter will create the CC attribute on the mail header. In the code, you would have something like below.

DynamicConfiguration configuration = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
/**any other required fields**/

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Mail", "THeaderCC");
configuration.put(key, "ccemail @ test.com");

Former Member
0 Kudos

Hi,

These attributes are not part of the target structure but message specific attributes of the mail adapter.

As mentioned in the posts above, you would need to use a UDF to populate these attributes for the BCC and CC you intend to send to.

Once you do this, then you would not need to mention the BCC or CC in your mail communication channel. At runtime, these values would be populated into the BCC and CC fields.

Regards

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sreeramulu,

As mentioned by Lucas, you can use the UDF. Inn addition to that, you need to define the Variable Headers under Variable transport binding after enabling the Adapter Specific Message Attributes.

For the Enabling ASMA, follow the below steps and check for the variable attributes.

Select the Advanced tab page.

To save adapter-specific attributes in the message header of the XI message, select Use Adapter-Specific Message Attributes and Variable Transport Binding.

The following attributes in the message header are then available for processing:

○ User: (technical name: TServerLocation)

○ Authentication key: (technical name: TAuthKey)

The following mail header fields are available for processing:

○ From: (technical name: THeaderFROM)

○ To: (technical name: THeaderTO)

○ Cc: (technical name: THeaderCC)

○ Bcc: (technical name: THeaderBCC)

○ Subject: (technical name: THeaderSUBJECT)

○ Reference to the mail that is to be replied to: (technical name: THeaderIN-REPLY-TO)

○ Reply to: (technical name: THeaderREPLY-TO)

○ Mail client program: (technical name: THeaderX-MAILER)

○ Send confirmation of receipt: (technical name: THeaderDISPOSITION-NOTIFICATION-TO)

○ Priority: (technical name: THeaderPRIORITY)

○ Importance of message: (technical name: THeaderIMPORTANCE)

To transfer further header fields, set the relevant indicator for Variable Header. The technical names for the fields are XHeaderName1, XHeaderName2, and XHeaderName3.

The parameters are included in the mail header under the names specified here.

The attribute namespace for the adapter is http://sap.com/xi/XI/System/Mail.

Thanks,

former_member463616
Contributor
0 Kudos

Hi,

As suggested by Lucas, you can go through. In addition you have to select "ASMA" and "Variable Transport Binding".

The above logic is work when you do not select 'mail package'.

Regards,

P.Rajesh

Former Member
0 Kudos

You can use ASMA and set the fields THeaderCC and THeaderBCC dynamically.

http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm