<?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 Mailing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264081#M148582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Can Anyone Knows to mail a gif image as an attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ahasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Apr 2006 12:21:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-03T12:21:38Z</dc:date>
    <item>
      <title>Mailing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264081#M148582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Can Anyone Knows to mail a gif image as an attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ahasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2006 12:21:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264081#M148582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-03T12:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Mailing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264082#M148583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai mohammed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this weblog its already been discussed here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="129740"&gt;&lt;/A&gt;&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;praba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2006 12:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264082#M148583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-03T12:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mailing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264083#M148584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check out this code sample using cl_bcs class to attach GIF image loaded from desktop (using gui_upload) and mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT bcs_example_5.

* This example shows how to send
*   - a simple text provided in an internal table of text lines
*   - and an attached MS word document provided in internal table
*   - to some internet email address.
*
* All activities done via facade CL_BCS!

DATA: send_request       TYPE REF TO cl_bcs.
DATA: text               TYPE bcsy_text.
data: binary_content     type solix_tab.
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: bcs_exception      type ref to cx_bcs.
data: sent_to_all        type os_boolean.



START-OF-SELECTION.

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      = 'd:Documents and SettingsxxxxDesktoploading.gif'
   FILETYPE                      = 'BIN'
*   HAS_FIELD_SEPARATOR           = ' '
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
*   VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
* IMPORTING
*   FILELENGTH                    = FILELENGTH
*   HEADER                        = HEADER
  TABLES
    data_tab                      = binary_content
 EXCEPTIONS
   FILE_OPEN_ERROR               = 1
   FILE_READ_ERROR               = 2
   NO_BATCH                      = 3
   GUI_REFUSE_FILETRANSFER       = 4
   INVALID_TYPE                  = 5
   NO_AUTHORITY                  = 6
   UNKNOWN_ERROR                 = 7
   BAD_DATA_FORMAT               = 8
   HEADER_NOT_ALLOWED            = 9
   SEPARATOR_NOT_ALLOWED         = 10
   HEADER_TOO_LONG               = 11
   UNKNOWN_DP_ERROR              = 12
   ACCESS_DENIED                 = 13
   DP_OUT_OF_MEMORY              = 14
   DISK_FULL                     = 15
   DP_TIMEOUT                    = 16
   OTHERS                        = 17
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

    PERFORM main.


*---------------------------------------------------------------------*
*       FORM main                                                     *
*---------------------------------------------------------------------*
FORM main.

  try.
*     -------- create persistent send request ------------------------
      send_request = cl_bcs=&amp;gt;create_persistent( ).

*     -------- create and set document with attachment ---------------
*     create document from internal table with text
      APPEND 'Hello world!' TO text.
      document = cl_document_bcs=&amp;gt;create_document(
                      i_type    = 'RAW'
                      i_text    = text
                      i_length  = '12'
                      i_subject = 'test created by BCS_EXAMPLE_2' ).

*     add attachment to document
*     BCS expects document content here e.g. from document upload
*     binary_content = ...
      CALL METHOD document-&amp;gt;add_attachment
        EXPORTING  i_attachment_type = 'GIF'
                   i_attachment_subject = 'My attachment'
                   i_att_content_hex    = binary_content.

*     add document to send request
      CALL METHOD send_request-&amp;gt;set_document( document ).

*     --------- set sender -------------------------------------------
*     note: this is necessary only if you want to set the sender
*           different from actual user (SY-UNAME). Otherwise sender is
*           set automatically with actual user.

      sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).
      CALL METHOD send_request-&amp;gt;set_sender
        EXPORTING i_sender = sender.

*     --------- add recipient (e-mail address) -----------------------
*     create recipient - please replace e-mail address !!!
      recipient = cl_cam_address_bcs=&amp;gt;create_internet_address(
                                        'raja@xxxx.com' ).

*     add recipient with its respective attributes to send request
      CALL METHOD send_request-&amp;gt;add_recipient
        EXPORTING
          i_recipient  = recipient
          i_express    = 'X'.
 CALL METHOD send_request-&amp;gt;set_send_immediately( 'X' ).

*     ---------- send document ---------------------------------------
      CALL METHOD send_request-&amp;gt;send(
        exporting
          i_with_error_screen = 'X'
        receiving
          result              = sent_to_all ).
      if sent_to_all = 'X'.
        write text-003.
      endif.

      COMMIT WORK.


* -----------------------------------------------------------
* *                     exception handling
* -----------------------------------------------------------
* * replace this very rudimentary exception handling
* * with your own one !!!
* -----------------------------------------------------------
  catch cx_bcs into bcs_exception.
    write: 'Fehler aufgetreten.'(001).
    write: 'Fehlertyp:'(002), bcs_exception-&amp;gt;error_type.
    exit.

  endtry.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2006 12:59:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mailing/m-p/1264083#M148584</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-04-03T12:59:04Z</dc:date>
    </item>
  </channel>
</rss>

