Adding attachments to your message
In this recipe, we will see how we can add attachments to our e-mail message (we will use the program created in the previous recipe). We will also use the code fragment from the XML String (for Excel data) generated in the Downloading into Excel made easy using simple transformations recipe of Chapter 10, Simple Transformations chapter.
We will copy the program of the last recipe and add the transformation code for the conversion into binary file of the XML string. We will then write the code for attaching the XML file to the e-mail message. The recipe shows the additional code required to attach a file to the e-mail.
The necessary steps for defining the send request and the subsequent steps are the same. This recipe code will be inserted after the create_document
method call of the cl_document_bcs
class and before the set_document
method call of the cl_bcs
class.
How to do it...
We will now perform the steps shown as follows:
After the
CALL TRANSFORMATION
...