12-02-2009 3:29 PM
Hi gurus,
I would like to add arbitrary email headers to emails generated by custom ABAP in SAP. I have tried passing these in the i_header parameter when using method cl_document_bcs=>create_document to create the send document/email. However this doesn't seem to have the desired effect - the header data could not be found when I received the email.
Specifically I would like to add:
X-Message-Flag: Follow up
Reply-By: Mon, 30 Nov 2009 12:45:00 +0100
Does anyone know if it is possible in ABAP to explicitly add your own email headers?
Thanks in advance for any advice,
Richard
12-02-2009 3:49 PM
Hi,
In Standard SAP, the standard function modules responsible for email header and then sending the mail is, 'ADDR_GET_NEXT_COMM_TYPE'.
Import parameters of this function module is holding the subject, reciever etc.
So put a break point at this function module in update mode switched and check where exactly it got triggerred and try replacing the same with custom include if possible.
It works.........
09-01-2011 12:53 AM
Hi Richard,
I have asked a similar question over at this thread:
Have you determined whether it is possible to add additional SMTP headers to SAP-generated emails?
The recommendation from Santhosh re. FM 'ADDR_GET_NEXT_COMM_TYPE' doesn't appear to be suitable - there are no relevant parameters and standard send processing (via. SOST) does not use this FM.
Regards
Hagen
09-01-2011 1:22 AM
09-02-2011 6:20 AM
Email headers are constructed in the following location:
Class: cl_bcom_mime_message_smtp
Method: add_header
add_header is a protected instance method, so cannot be called from any class not inheriting from cl_bcom_mime_message_smtp. However, cl_bcom_mime_message_smtp is declared Final... that is, no class can inherit from it.
In order to add custom SMTP headers, you'd need to add an implicit enhancement at the end of the method.
Hope it's of use.
08-27-2014 1:10 PM
Hi Hagen,
did you solve it without adding an implicit enhancement?
it's seems there are no possibilities to add custom header fields with standard CL_BCS..