Sometimes, it is necessary to send emails with the Formatting when we are sending the email using SAPConnect.
Formatting is necessary to display proper information. For example, Information is formatted repesentation of the Data. If no formatting, no information. Same way, if we send the unformatted contents, than it will make wrong impression.
In ABAP also, using the SAPConnect function modules we can send the highly formatted contents in the Message body. For this purpose, we need to use HTML. HTML will represent our data in the formatted way on receipient side.
While filling up the Body of the message (CONTENTS_TXT), we fill it up with the HTML code. After filling up the content, we need to tell the system that we are sending the HTML data instead of the pure text. Generally, we specify the DOC_TYPE in PACKING_LIST as the TEXT. But for this purpose, we will pass HTML since our data is in HTML. Than we will pass all the information to the Function Module SO_NEW_DOCUMENT_ATT_SEND_API1.
Code Snippet to send the Email with Formatting: Email with Formatting code snippet
( I am not able to post the code in this blog because it contains the HTML tags and Blogger engine doesnot allow me to add it here).
This code snippet will generate the output:
For HTML tags you can visit: HTML Tag List