Skip to Content
author's profile photo Former Member
Former Member

Use Table and atthacment and sending mail

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 01:12 PM

    I close it,

    i sorry but somehow i dont see this post after i send it for 20 minute

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.