Skip to Content
0
May 11, 2012 at 09:23 PM

Email with HTML content is not working in production system!!!

101 Views

We implemented program to send email with HTML content. Using BCS class for it. Below is the code... This is working fine in all the systems but not in our production system. In production, we are receiving emails without formatting i.e. with HTML tags as plain text document. Mail has details about content type and it says "text/html" is type but when we look at source there it is "text/plain". We have one pre-production system which is recent copy of our production system and this is working fine in pre-production system. Please let me know if you have any clue...

try.

obj_cl_bcs = cl_bcs=>create_persistent( ).

lv_document = cl_document_bcs=>create_document(

i_type = 'HTM'

i_text = objcont

i_length = l_doc_len

i_subject = subject_dummy

i_language = sy-langu

i_importance = '1' ).

call method obj_cl_bcs->set_document( lv_document ).

* Sender email Address

lv_sender = cl_cam_address_bcs=>create_internet_address( v_smail ).

obj_cl_bcs->set_sender( lv_sender ).

* Receiver email address

lv_recipient = cl_cam_address_bcs=>create_internet_address(

v_email ).

call method obj_cl_bcs->add_recipient exporting i_recipient = lv_recipient

i_express = 'X'.

* Receiver email address

lv_cc_mailid = cl_cam_address_bcs=>create_internet_address(

v_smail ).

call method obj_cl_bcs->add_recipient exporting i_recipient = lv_cc_mailid

i_copy = 'X'.

call method obj_cl_bcs->set_status_attributes(

i_requested_status = 'E'

i_status_mail = 'E').

call method obj_cl_bcs->set_message_subject exporting ip_subject = subject.

* Send email

call method obj_cl_bcs->set_send_immediately

exporting

i_send_immediately = 'X'.

call method obj_cl_bcs->send(

exporting

i_with_error_screen = 'X'

receiving

result = l_request ).

catch cx_document_bcs .

catch cx_send_req_bcs.

catch cx_address_bcs.

endtry.

commit work.

Thanks,

Naveen Inuganti.