Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamic receiver and sender on Mail Module Adapter

Hello

I´m building an email module adapter that I have to set the mail sender and receiver.

I DONT want to do that on message mapping udf, I want to use it directly on my mail module.

The code being used is:

..

Message mailMessage = (Message)imd.getPrincipalData();

...

MessagePropertyKey propTo = new MessagePropertyKey("THeaderTO","http://sap.com/xi/XI/System/Mail");

mailMessage.setMessageProperty(propTo,"toyou@you.com");

MessagePropertyKey propFrom = new MessagePropertyKey("THeaderFROM","http://sap.com/xi/XI/System/Mail");

mailMessage.setMessageProperty(propFrom,"fromme@me.com");

...

But on Audit Log I keep receiving this error: Mail: Error occurred: java.io.IOException: no receiver address specified

Option Set Adapter-Specific Message Attributes is checked

Thanks

Former Member
replied

Hi Vitor,

You need to add the variable names in the XHeaderName1,XheaderName2...

Add these parameters for sender and receiver channel and test again.

Thanks,

Anand

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question