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 to multiple users

shekhar_439
Explorer
0 Kudos

Send E-mails to more than one customer e-mail address at the same time with attachment PDF.

1 ACCEPTED SOLUTION

ThorstenHoefer
Active Contributor

Hi,

please check https://codezentrale.de/tag/add_attachment/

you can call o_send_request->add_recipient multiple times.

6 REPLIES 6

ThorstenHoefer
Active Contributor

Hi,

please check https://codezentrale.de/tag/add_attachment/

you can call o_send_request->add_recipient multiple times.

0 Kudos

thanks..................................

0 Kudos

Any Other Way to do

shekhar_439 Why do you ask "Any Other Way to do"? Don't you think caling "add_recipient multiple times" is very simple?

Eduardo-CE
Active Participant
0 Kudos

Hello,

DATA: l_document   TYPE REF TO cl_document_bcs,
        w_document   TYPE REF TO cl_bcs,
        gv_emailt    TYPE adr6-smtp_addr,
        gv_emailf    TYPE adr6-smtp_addr,
        gr_recipient TYPE REF TO if_recipient_bcs,
        sender       TYPE REF TO cl_cam_address_bcs.
		
		 CREATE OBJECT l_document.
      l_document = cl_document_bcs=>create_document(
          i_type       = 'HTM'
          i_subject    = v_subject
          i_length     = v_length
          i_language   = sy-langu
          i_importance = '1'
          i_text       = it_mailtxt ).
		
		 w_document = cl_bcs=>create_persistent( ).
      CALL METHOD w_document->set_document( l_document ).
	  
	  LOOP AT it_emails INTO wa_emails.
          v_user = wa_emails-sysid.

          CALL FUNCTION 'BAPI_USER_GET_DETAIL'
            EXPORTING
              username = v_user
            IMPORTING
              address  = wa_addr
            TABLES
              return   = it_return.

          gv_emailt = wa_addr-e_mail.

          gr_recipient = cl_cam_address_bcs=>create_internet_address( gv_emailt ).

          CALL METHOD w_document->add_recipient
            EXPORTING
              i_recipient = gr_recipient
              i_express   = 'X'.

          FREE: wa_emails, gv_emailt, v_user.
        ENDLOOP.
		
		CALL METHOD w_document->send(
        EXPORTING
          i_with_error_screen = 'X'
        RECEIVING
          result              = l_result ).

0 Kudos

can one vendor send same time multi customer with attach pdf