Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

send mail help

Former Member
0 Kudos
61

Hallow

here I send maail to one person and ts working o.k. but the problem is when I wont to send To more then one person how can I do that?

send_request = cl_bcs=>create_persistent( ).

  • -------- Create And Set Document ( Mail Text)----------------

CONCATENATE text-003 wa_emp_tab-werks text-004 wa_emp_tab-btrtl

INTO p_line1 SEPARATED BY space.

APPEND p_line1 TO text.

p_line1 = text-013 .

APPEND p_line1 TO text.

p_line1 = '----


'.

APPEND p_line1 TO text.

LOOP AT descreption_tab INTO wa_descreption_tab.

CONCATENATE text-006 wa_descreption_tab-out_hagbla wa_descreption_tab-text_hagbla ' '

text-007 wa_descreption_tab-out_rama wa_descreption_tab-text_description

INTO p_line1 SEPARATED BY space.

APPEND p_line1 TO text.

ENDLOOP.

p_line1 = '----


'.

APPEND p_line1 TO text. "Text of mail table

<b>SELECT single value

FROM yhr_parameters " Adress Table

INTO wa_mail_addr

WHERE title = 'YHR'

AND subtitle = 'MU'

AND name = 'SEND_MAIL'.</b>

document = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = text

i_length = '12'

i_subject = text-010 ). "Header Of Mail

  • Add document to send request

CALL METHOD send_request->set_document( document ).

  • Set sender

sender = cl_sapuser_bcs=>create( sy-uname ).

CALL METHOD send_request->set_sender

EXPORTING

i_sender = sender.

  • Add recipient (e-mail address)

recipient = cl_cam_address_bcs=>create_internet_address( wa_mail_addr ).

  • Add recipient with its respective attributes to send request

CALL METHOD send_request->add_recipient

EXPORTING

i_recipient = recipient

i_express = 'X'.

  • Send document

CALL METHOD send_request->send(

EXPORTING

i_with_error_screen = 'X'

RECEIVING

result = sent_to_all ).

COMMIT WORK.

2 REPLIES 2

Former Member
0 Kudos
44

hi all

please give me direction i dont now if to do loop or concatenete to one field (wa_mail_addr1)all the adress that i wont spereted by space or ;

to

recipient = cl_cam_address_bcs=>create_internet_address( wa_mail_addr ).

regards

Former Member
0 Kudos
44

hi all

when i send mail to one person its working well the problem is just when i send to more then one person

regards