2008 Oct 29 10:11 AM
Hi ,
With help from this forum i success in sending mail with internal and other program that send mail with attachment,
now the last thihng is to combin of the both,
i try do do it like this way (below) and i get 2 diifrent mail ,
Now i now that i give the mail adress twice and i write all thing twice and i not had to ,
but when i do it once it send just the : send_request , document, recipient...not with IO_....
i write it twice for the help.
i new In Abap OO how can i solve this ?
Regards
TRY.
send_request = cl_bcs=>create_persistent( ).
lo_send_request = cl_bcs=>create_persistent( ).
lo_document = cl_document_bcs=>create_document( i_type = 'HTM'
i_text = lt_html[]
i_subject = 'Table' ).
document = cl_document_bcs=>create_document( i_type = 'RAW'
i_text = lt_text
i_subject = 'Check this' ).
APPEND 'Test Message' TO lt_text.
document->add_attachment( EXPORTING i_attachment_type = 'BIN'
i_attachment_subject = mail_type
i_att_content_hex = lt_attach ).
lo_send_request->set_document( lo_document ).
send_request->set_document( document ).
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
lo_recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
send_request->add_recipient( i_recipient = recipient i_express = 'X' ).
lo_send_request->add_recipient( i_recipient = lo_recipient i_express = 'X' ).
send_request->set_send_immediately( 'X' ).
sent_to_all = send_request->send( i_with_error_screen = 'X' ).
lo_send_request->add_recipient( EXPORTING i_recipient = lo_recipient
i_express = 'X' ).
lo_send_request->set_send_immediately( 'X' ).
lv_sent_to_all = lo_send_request->send( 'X' ).
COMMIT WORK.
CATCH cx_bcs INTO bcs_exception.
lv_error_txt = bcs_exception->get_text( ).
WRITE:`Error : ` , lv_error_txt.
EXIT.
ENDTRY.
Regards
Hi ,
With help from this forum i success in sending mail with internal and other program that send mail with attachment,
now the last thihng is to combin of the both,
i try do do it like this way (below) and i get 2 diifrent mail ,
Now i now that i give the mail adress twice and i write all thing twice and i not had to ,
but when i do it once it send just the : send_request , document, recipient...not with IO_....
i write it twice for the help.
i new In Abap OO how can i solve this ?
Regards
TRY.
send_request = cl_bcs=>create_persistent( ).
lo_send_request = cl_bcs=>create_persistent( ).
lo_document = cl_document_bcs=>create_document( i_type = 'HTM'
i_text = lt_html[]
i_subject = 'Table' ).
document = cl_document_bcs=>create_document( i_type = 'RAW'
i_text = lt_text
i_subject = 'Check this' ).
APPEND 'Test Message' TO lt_text.
document->add_attachment( EXPORTING i_attachment_type = 'BIN'
i_attachment_subject = mail_type
i_att_content_hex = lt_attach ).
lo_send_request->set_document( lo_document ).
send_request->set_document( document ).
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
lo_recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
send_request->add_recipient( i_recipient = recipient i_express = 'X' ).
lo_send_request->add_recipient( i_recipient = lo_recipient i_express = 'X' ).
send_request->set_send_immediately( 'X' ).
sent_to_all = send_request->send( i_with_error_screen = 'X' ).
lo_send_request->add_recipient( EXPORTING i_recipient = lo_recipient
i_express = 'X' ).
lo_send_request->set_send_immediately( 'X' ).
lv_sent_to_all = lo_send_request->send( 'X' ).
COMMIT WORK.
CATCH cx_bcs INTO bcs_exception.
lv_error_txt = bcs_exception->get_text( ).
WRITE:`Error : ` , lv_error_txt.
EXIT.
ENDTRY.
Regards
2008 Oct 29 12:52 PM