<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Send email to multiple user in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799370#M913702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;MAke the changes according to:&lt;/P&gt;&lt;P&gt;Add the recipients email address &lt;/P&gt;&lt;P&gt;CLEAR t_receivers.&lt;/P&gt;&lt;P&gt;REFRESH t_receivers.&lt;/P&gt;&lt;P&gt;t_receivers-receiver = Emailid1&lt;/P&gt;&lt;P&gt;t_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;t_receivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;APPEND t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_receivers-receiver = emailid2&lt;/P&gt;&lt;P&gt;t_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;t_receivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;APPEND t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_receivers-receiver = emailid3&lt;/P&gt;&lt;P&gt;t_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;t_receivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;APPEND t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SO_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;document_data = w_doc_data&lt;/P&gt;&lt;P&gt;put_in_outbox = 'X'&lt;/P&gt;&lt;P&gt;sender_address = ld_sender_address&lt;/P&gt;&lt;P&gt;sender_address_type = ld_sender_address_type&lt;/P&gt;&lt;P&gt;commit_work = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;sent_to_all = w_sent_all&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;packing_list = t_packing_list&lt;/P&gt;&lt;P&gt;contents_bin = t_attachment&lt;/P&gt;&lt;P&gt;contents_txt = it_message&lt;/P&gt;&lt;P&gt;receivers = t_receivers&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2008 10:06:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-15T10:06:06Z</dc:date>
    <item>
      <title>Send email to multiple user</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799368#M913700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All experts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    I want to send an email to multiple user, I use the FM:SO_NEW_DOCUMENT_SEND_API1, &lt;/P&gt;&lt;P&gt;this FM can to mutiple user's email address ,but it can not re-set the email sender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another FM is: EFG_GEN_SEND_EMAIL, this FM can re-set the email sender and email receiver, but this only can send one email to one receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is, can anyone tell me how to send email to mutiple user,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.: sender: abc/at/abc.com&lt;/P&gt;&lt;P&gt;        receiver 1  cdg/at/abc.com&lt;/P&gt;&lt;P&gt;        receiver 2   dd/at/hotmail.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to send this email to both them at a time. and i can dynamic set the email sender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 09:47:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799368#M913700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T09:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Send email to multiple user</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799369#M913701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can very well use the same FM to send the email to multiple users. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FM : SO_NEW_DOCUMENT_SEND_API1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables parameter has receiver  RECEIVERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append the emails that you want to send to this internal table and pass it to the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          wa_receiver-rec_type = 'U".&lt;/P&gt;&lt;P&gt;          wa_receiver-receiver = 'email1'.&lt;/P&gt;&lt;P&gt;          APPEND wa_receiver TO t_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_receiver TYPE STANDARD TABLE OF somlreci1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if u find this useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 10:03:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799369#M913701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T10:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send email to multiple user</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799370#M913702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;MAke the changes according to:&lt;/P&gt;&lt;P&gt;Add the recipients email address &lt;/P&gt;&lt;P&gt;CLEAR t_receivers.&lt;/P&gt;&lt;P&gt;REFRESH t_receivers.&lt;/P&gt;&lt;P&gt;t_receivers-receiver = Emailid1&lt;/P&gt;&lt;P&gt;t_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;t_receivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;APPEND t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_receivers-receiver = emailid2&lt;/P&gt;&lt;P&gt;t_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;t_receivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;APPEND t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_receivers-receiver = emailid3&lt;/P&gt;&lt;P&gt;t_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;t_receivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;t_receivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;APPEND t_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SO_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;document_data = w_doc_data&lt;/P&gt;&lt;P&gt;put_in_outbox = 'X'&lt;/P&gt;&lt;P&gt;sender_address = ld_sender_address&lt;/P&gt;&lt;P&gt;sender_address_type = ld_sender_address_type&lt;/P&gt;&lt;P&gt;commit_work = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;sent_to_all = w_sent_all&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;packing_list = t_packing_list&lt;/P&gt;&lt;P&gt;contents_bin = t_attachment&lt;/P&gt;&lt;P&gt;contents_txt = it_message&lt;/P&gt;&lt;P&gt;receivers = t_receivers&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 10:06:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799370#M913702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T10:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Send email to multiple user</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799371#M913703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a good practice to write a function to send email and use this function as much as you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please create the following function exactly,&lt;/P&gt;&lt;P&gt;it will help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You see imports and exports of this function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO1 through TO3 is the mail adresses you can pass. You can use just one of them or all of them.&lt;/P&gt;&lt;P&gt;And  you can use the  &lt;STRONG&gt;BODY&lt;/STRONG&gt; STRUCTURE  TLINE OPTIONAL&lt;/P&gt;&lt;P&gt;as the contents of the email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION Z_PA_SENDMAIL.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(TO1) LIKE  ADR6-SMTP_ADDR
*"     VALUE(TO2) LIKE  ADR6-SMTP_ADDR OPTIONAL
*"     VALUE(TO3) LIKE  ADR6-SMTP_ADDR OPTIONAL
*"     VALUE(SUBJECT) LIKE  TZV51-XBRIEF
*"     VALUE(ATT_TYPE) LIKE  SOOD-OBJTP OPTIONAL
*"     VALUE(ATT_NAME) LIKE  SOOD-OBJNAM OPTIONAL
*"     VALUE(ATT_DESC) LIKE  SOOD-OBJDES OPTIONAL
*"     VALUE(NOTIF_DEL) LIKE  SOMLRECI1-NOTIF_DEL OPTIONAL
*"     VALUE(NOTIF_READ) LIKE  SOMLRECI1-NOTIF_READ OPTIONAL
*"     VALUE(NOTIF_NDEL) LIKE  SOMLRECI1-NOTIF_NDEL DEFAULT 'X'
*"     VALUE(SEND_AS) LIKE  SOEXTRECI1-RECEIVER DEFAULT SPACE
*"  EXPORTING
*"     VALUE(SENT_FLAG) LIKE  SOPR-FLAG1
*"  TABLES
*"      BODY STRUCTURE  TLINE OPTIONAL
*"      ATTCH STRUCTURE  SOLISTI1 OPTIONAL
*"  EXCEPTIONS
*"      TOO_MANY_RECEIVERS
*"      DOCUMENT_NOT_SENT
*"      OPERATION_NO_AUTHORIZATION
*"----------------------------------------------------------------------

 data: doc_chng like sodocchgi1.
 data : objpack like sopcklsti1   occurs 10 with header line,
        objhead like solisti1     occurs 10 with header line,
        objbin  like solisti1     occurs 10 with header line,
        objtxt  like solisti1     occurs 10 with header line,
        reclist like somlreci1    occurs 10 with header line.
 data: tab_lines like sy-tabix.
 data: sent_to_all like sonv-flag.

 objtxt[] = body[].
 objbin[] = attch[].

 doc_chng-obj_name  = 'Mail'.
 doc_chng-obj_descr = subject.

* Creation of the entry for the compressed document
 describe table objtxt lines tab_lines.
 clear objpack-transf_bin.
 objpack-head_start = 1.
 objpack-head_num = 0.
 objpack-body_start = 1.
 objpack-body_num = tab_lines.

 read table objtxt index tab_lines.
 objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
 doc_chng-doc_size = doc_chng-doc_size + objpack-doc_size.
 objpack-doc_type = 'RAW'.
 objpack-obj_name  = 'Body'.
 objpack-obj_descr = subject.
 append objpack.

 describe table objbin lines tab_lines.
 if tab_lines &amp;gt; 0.
  objpack-transf_bin = 'X'.
  objpack-head_start = 1.
  objpack-head_num = 0.
  objpack-body_start = 1.
  objpack-body_num = tab_lines.

  read table objbin index tab_lines.
  objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objbin ).
  doc_chng-doc_size = doc_chng-doc_size + objpack-doc_size.
  objpack-doc_type = att_type.
  objpack-obj_name = att_name.
  objpack-obj_descr = att_desc.
  append objpack.
 endif.

 reclist-rec_type  = 'U'.
 reclist-notif_del = NOTIF_DEL.
 reclist-notif_read = NOTIF_READ.
 reclist-notif_ndel = NOTIF_NDEL.
 reclist-receiver  = to1.
 append reclist.
 if not to2 is initial.
  reclist-receiver  = to2.
  append reclist.
 endif.
 if not to3 is initial.
  reclist-receiver  = to3.
  append reclist.
 endif.

 delete reclist where receiver eq space.

  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       exporting
            document_data              = doc_chng
            put_in_outbox              = ' '
            commit_work                = 'X'
*            SENDER_ADDRESS             = send_as
       importing
            sent_to_all                = sent_flag
       tables
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
       exceptions
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            others                     = 99.

  case sy-subrc.
   when 0.
* SUCCESS
   when 1.
    raise TOO_MANY_RECEIVERS.
   when 2.
    raise DOCUMENT_NOT_SENT.
   when 4.
    raise OPERATION_NO_AUTHORIZATION.
   when others.
    raise OTHERS.
  endcase.

ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 10:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-email-to-multiple-user/m-p/3799371#M913703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T10:54:00Z</dc:date>
    </item>
  </channel>
</rss>

