Why I can't find a mail in SOST?
By using the following coding, I expect to find a internet-mail in SOST (unsent, because it's a test system, but it has to be there).
What I'm doing wrong???
DATA: ex_bcs TYPE REF TO cx_bcs.
" create mail document
DATA(mail) = cl_document_bcs=>create_document(
i_text = VALUE #( ( CONV so_text255( 'Testmail' ) ) )
i_type = 'RAW'
i_subject = 'Testsubject' ).
DATA(send_request) = cl_bcs=>create_persistent( ).
send_request->set_document( mail ).
send_request->set_sender( i_sender = cl_cam_address_bcs=>create_internet_address( 'email@example.com' ) ) ##NO_TEXT.
send_request->add_recipient( i_recipient = cl_cam_address_bcs=>create_internet_address( 'firstname.lastname@example.org' ) ).
MESSAGE ID ex_bcs->msgid TYPE ex_bcs->msgty NUMBER ex_bcs->msgno
WITH ex_bcs->msgv1 ex_bcs->msgv2 ex_bcs->msgv3 ex_bcs->msgv4.
" do not forget to commit, otherwise the mail will not be sent!
IF send_request->send( i_with_error_screen = abap_true ) = abap_true.
" I expect to find an SOST entry, now.
there is no error in your code: I've pasted your code to a Z report and i've the test email waiting in SOST with yellow status.
Maybe something with customizing ? ....