<?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 mail using class in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684528#M620789</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2007 09:46:53 GMT</pubDate>
    <dc:creator>david_fryda2</dc:creator>
    <dc:date>2007-08-14T09:46:53Z</dc:date>
    <item>
      <title>Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684520#M620781</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;I need to send PDF files as attachment to a mail using Classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 11:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684520#M620781</guid>
      <dc:creator>david_fryda2</dc:creator>
      <dc:date>2007-08-12T11:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684521#M620782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you already check the    IF_SWF_UTL_MAIL   ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attila&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 17:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684521#M620782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-12T17:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684522#M620783</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;I have develop this code to send multiple HTML attachments using CL_BCS class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Form f_send_html_mail.
  data: send_request       type ref to cl_bcs.
  data: document           type ref to cl_document_bcs.
  data: sender             type ref to cl_sapuser_bcs.
  data: recipient          type ref to if_recipient_bcs.
  data: exception_info     type ref to if_os_exception_info,
  bcs_exception            type ref to cx_document_bcs.

  data i_attachment_size type sood-objlen.
  data v_status          type bcs_stml.
  data v_request_status  type bcs_rqst.

  data : v_desc like sopcklsti1-obj_descr.

      concatenate 'Doc-' pdocno into v_desc.
      condense v_desc no-gaps.
      submit yttcr0001 exporting list to memory
               with p_docno = pdocno
               and return.

    call function 'LIST_FROM_MEMORY'
      tables
        listobject = report_list
      exceptions
        not_found  = 1
        others     = 2.

    call function 'WWW_HTML_FROM_LISTOBJECT'
      exporting
        template_name = 'WEBREPORTING_REPORT'
      tables
        html          = report_html
        listobject    = report_list.

    describe table objbin lines tab_lines.
    v_lines = tab_lines + 1.

    loop at report_html.
      move report_html to it_attach1.
      append it_attach1.
    endloop.

  send_request = cl_bcs=&amp;gt;create_persistent( ).
  try.
      document = cl_document_bcs=&amp;gt;create_document(
                                    i_type    = 'RAW'
                                    i_text = it_content[]
                                    i_subject = subject ).
      if not attach_name1 is initial.
        call method document-&amp;gt;add_attachment
          exporting
            i_attachment_type    = attach_ext1
            i_attachment_subject = attach_name1
            i_att_content_text   = it_attach1[].
      endif.
     "&amp;lt;&amp;lt;&amp;lt; if you want multiple attachment then use this
      if not attach_name2 is initial.
        call method document-&amp;gt;add_attachment
          exporting
            i_attachment_type    = attach_ext2
            i_attachment_subject = attach_name2
            i_att_content_text   = it_attach2[].
      endif.

      call method send_request-&amp;gt;set_document( document ).
      sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).

      call method send_request-&amp;gt;set_sender
        exporting
          i_sender = sender.

      loop at it_recipient.
        translate it_recipient-smtp_addr to lower case.
        recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( it_recipient-smtp_addr ).
        call method send_request-&amp;gt;add_recipient
          exporting
            i_recipient  = recipient
            i_express    = ' '
            i_copy       = ' '
            i_blind_copy = ' '
            i_no_forward = ' '.
      endloop.
      move : 'E' to v_request_status.
      v_status = v_request_status.
      call method send_request-&amp;gt;set_status_attributes
        exporting
          i_requested_status = v_request_status
          i_status_mail      = v_status.
      call method send_request-&amp;gt;send( ).
      commit work.
    catch cx_document_bcs into bcs_exception.
  endtry.
endform.                                
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also check this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2005/01/05/develop-a-web-service-that-sends-an-email--in-abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 18:06:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684522#M620783</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-12T18:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684523#M620784</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;Just one question : How do you fill the it_attach1 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 08:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684523#M620784</guid>
      <dc:creator>david_fryda2</dc:creator>
      <dc:date>2007-08-13T08:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684524#M620785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use BCS for this&lt;/P&gt;&lt;P&gt;Check these progs BCS_EXAMPLE_1, BCS_EXAMPLE_2, BCS_EXAMPLE_3, BCS_EXAMPLE_4, BCS_EXAMPLE_5, BCS_EXAMPLE_6 in your R/3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;~Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 08:48:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684524#M620785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T08:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684525#M620786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;look via se38 for BCS_EXAMPLE_*.&lt;/P&gt;&lt;P&gt;There are very good examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 08:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684525#M620786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T08:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684526#M620787</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;How can I read the binary from file without using GUI_UPLOAD because I want to run the program in background ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 09:29:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684526#M620787</guid>
      <dc:creator>david_fryda2</dc:creator>
      <dc:date>2007-08-13T09:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684527#M620788</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;I have created my it_attach1...5 attachment this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form f_append_object_bin tables pattach structure soli
                         using pdocno pctc pscc .
  data : v_desc like sopcklsti1-obj_descr.

  if not pdocno is initial.
      concatenate 'TCC-' pdocno into v_desc.
      condense v_desc no-gaps.
      submit ytccr0001 exporting list to memory
               with p_docno = pdocno
               and return.

    call function 'LIST_FROM_MEMORY'
      tables
        listobject = report_list
      exceptions
        not_found  = 1
        others     = 2.

    call function 'WWW_HTML_FROM_LISTOBJECT'
      exporting
        template_name = 'WEBREPORTING_REPORT'
      tables
        html          = report_html
        listobject    = report_list.

    describe table objbin lines tab_lines.
    v_lines = tab_lines + 1.

    loop at report_html.
      move report_html to pattach.
      append pattach.
    endloop.

  endif.
endform.                                 " F_append_object_bin

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May this one help you out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 15:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684527#M620788</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-13T15:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Send mail using class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684528#M620789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 09:46:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-mail-using-class/m-p/2684528#M620789</guid>
      <dc:creator>david_fryda2</dc:creator>
      <dc:date>2007-08-14T09:46:53Z</dc:date>
    </item>
  </channel>
</rss>

