<?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 HTML mail with image in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722055#M1298252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hm, I managed it to upload the image into the Web Repistory and this is the URL which is builded:&lt;/P&gt;&lt;P&gt;"SAPR3://DE4BBB2FAA4798F197D8001438C4EA66". Unfortunately, when putting this into the HTML image tag, I still get a broken image (red cross) in the HTML mail. I have to state that I had the receive the same ID for the image all the time, I mean before I've uploaded it with SMW0. Most likely because I have uploaded it with OAER and SE78.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, FM DP_CREATE_URL returns URL "SAPR3://DE4BBB2FAA4798F197D8001438C4EA66", which seems to be not valid for an image tag. Any idea what might be the issue now?&lt;/P&gt;&lt;P&gt;Could it be that I have to attach the image to the mail object instead of simply use it in the image tag?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, your help is highly appreciated!!! Thanks a lot!&lt;/P&gt;&lt;P&gt;Regards, Steffen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on May 28, 2009 9:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2009 19:20:27 GMT</pubDate>
    <dc:creator>steffen_weber</dc:creator>
    <dc:date>2009-05-28T19:20:27Z</dc:date>
    <item>
      <title>Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722045#M1298242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts and gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can I send an HTML email which is displaying an image in the HTML context (table)?&lt;/P&gt;&lt;P&gt;I'm using the 'SO_NEW_DOCUMENT_SEND_API1' like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = ls_doc_data
      document_type              = 'HTM'
      put_in_outbox                = 'X'
      commit_work                 = 'X'
    TABLES
      object_content             = gt_mail_body
      receivers                  = gt_receiver .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that might switch to function module 'SO_NEW_DOCUMENT_ATT_SEND_API1', but I have no clue how to set up the PACKING_LIST properly and to incorporate the image into the HTML code afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Steffen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 08:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722045#M1298242</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-27T08:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722046#M1298243</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;check below link its useful for u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/profile?editmode=true&amp;amp;userid=3669065" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/profile?editmode=true&amp;amp;userid=3669065&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 10:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722046#M1298243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-27T10:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722047#M1298244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the link leads to your profile page...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Steffen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 10:53:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722047#M1298244</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-27T10:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722048#M1298245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Steffen ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this:&lt;/P&gt;&lt;P&gt;FORM docu_send_email USING pv_otfdata TYPE tsfotf pv_emailid TYPE any pv_formname TYPE any. DATA: lv_filesize TYPE i, lv_buffer TYPE string, lv_attachment TYPE i, lv_testo TYPE i. DATA: li_pdfdata TYPE STANDARD TABLE OF tline, li_mess_att TYPE STANDARD TABLE OF solisti1, li_mtab_pdf TYPE STANDARD TABLE OF tline, li_objpack TYPE STANDARD TABLE OF sopcklsti1, li_objtxt TYPE STANDARD TABLE OF solisti1, li_objbin TYPE STANDARD TABLE OF solisti1, li_reclist TYPE STANDARD TABLE OF somlreci1, li_objhead TYPE soli_tab. DATA: lwa_pdfdata TYPE tline, lwa_objpack TYPE sopcklsti1, lwa_mess_att TYPE solisti1, lwa_objtxt TYPE solisti1, lwa_objbin TYPE solisti1, lwa_reclist TYPE somlreci1, lwa_doc_chng TYPE sodocchgi1. CONSTANTS: lc_u TYPE char1 VALUE 'U', lc_0 TYPE char1 VALUE '0', lc_1 TYPE char1 VALUE '1', lc_pdf TYPE char3 VALUE 'PDF', lc_raw TYPE char3 VALUE 'RAW', lc_ordform TYPE char15 VALUE 'ZORDCONFIRM_01', lc_attachment TYPE char10 VALUE 'ATTACHMENT'. CALL FUNCTION 'CONVERT_OTF' EXPORTING format = lc_pdf max_linewidth = 132 IMPORTING bin_filesize = lv_filesize TABLES otf = pv_otfdata lines = li_pdfdata EXCEPTIONS err_max_linewidth = 1 err_format = 2 err_conv_not_possible = 3 err_bad_otf = 4 OTHERS = 5. IF sy-subrc 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. LOOP AT li_pdfdata INTO lwa_pdfdata. TRANSLATE lwa_pdfdata USING ' &lt;SUB&gt;'. CONCATENATE lv_buffer lwa_pdfdata INTO lv_buffer. CLEAR lwa_pdfdata. ENDLOOP. TRANSLATE lv_buffer USING '&lt;/SUB&gt; '. DO. lwa_mess_att = lv_buffer. APPEND lwa_mess_att TO li_mess_att. CLEAR lwa_mess_att. SHIFT lv_buffer LEFT BY 255 PLACES. IF lv_buffer IS INITIAL. EXIT. ENDIF. ENDDO. * Object with PDF. REFRESH li_objbin. li_objbin] = li_mess_att[. DESCRIBE TABLE li_objbin LINES lv_attachment. * Object with main text of the mail. lwa_objtxt = space. APPEND lwa_objtxt TO li_objtxt. CLEAR lwa_objtxt. DESCRIBE TABLE li_objtxt LINES lv_testo. * Create the document which is to be sent lwa_doc_chng-obj_name = text-008. lwa_doc_chng-obj_descr = text-008. lwa_doc_chng-sensitivty = lc_0. lwa_doc_chng-obj_prio = lc_1. lwa_doc_chng-doc_size = lv_testo * 225. * Pack to main body. CLEAR lwa_objpack-transf_bin. * header lwa_objpack-head_start = 1. * The document needs no header (head_num = 0) lwa_objpack-head_num = 0. * body lwa_objpack-body_start = 1. lwa_objpack-body_num = lv_testo. lwa_objpack-doc_type = lc_raw. APPEND lwa_objpack TO li_objpack. CLEAR lwa_objpack. * Create the attachment. * Fill the fields of the packing_list for the attachment: lwa_objpack-transf_bin = gc_x . * header lwa_objpack-head_start = 1. lwa_objpack-head_num = 1. * body lwa_objpack-body_start = 1. lwa_objpack-body_num = lv_attachment. lwa_objpack-doc_type = lc_pdf. lwa_objpack-obj_name = lc_attachment. lwa_objpack-obj_descr = text-008. lwa_objpack-doc_size = lv_attachment * 255. APPEND lwa_objpack TO li_objpack. CLEAR lwa_objpack. lwa_reclist-receiver = pv_emailid. lwa_reclist-rec_type = lc_u. lwa_reclist-notif_del = gc_x. lwa_reclist-notif_ndel = gc_x. APPEND lwa_reclist TO li_reclist. IF li_reclist IS NOT INITIAL. CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' EXPORTING document_data = lwa_doc_chng put_in_outbox = gc_x TABLES packing_list = li_objpack object_header = li_objhead contents_bin = li_objbin contents_txt = li_objtxt receivers = li_reclist EXCEPTIONS too_many_receivers = 1 document_not_sent = 2 document_type_not_exist = 3 operation_no_authorization = 4 parameter_error = 5 x_error = 6 enqueue_error = 7 OTHERS = 8. IF sy-subrc 0. * MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno * WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. " DOCU_SEND_EMAIL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 11:47:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722048#M1298245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-27T11:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722049#M1298246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a l lot for your posting!!!&lt;/P&gt;&lt;P&gt;could you please also provide the code how you call this form, especially how the parameter pv_otfdata (TYPE tsfotf) is filled?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't get your code working, and by the way, I need to send an image (JPG, GIF), and not a PDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Steffen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 12:40:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722049#M1298246</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-27T12:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722050#M1298247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steffen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frankly I have never send an image with your FM, but maybe you will be interesed in using &lt;STRONG&gt;CL_BCS&lt;/STRONG&gt; class instead, which offers such posibility.&lt;/P&gt;&lt;P&gt;Please refer &lt;SPAN __jive_macro_name="thread" id="1342216"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"in point 3. of the above link, this is full coding which dispatches an email

  DATA: lr_email TYPE REF TO cl_bcs,
            lr_email_body TYPE REF TO cl_document_bcs,
            l_send_result TYPE c,
            lr_receiver TYPE REF TO if_recipient_bcs,
            l_subject TYPE so_obj_des,
           l_mail_address LIKE mail_address.

        lr_email_body = cl_document_bcs=&amp;gt;create_document(
                                         i_type = 'HTM'
                                         i_text = lt_message
                                         i_subject = l_subject ).
 
lr_email-&amp;gt;set_document( lr_email_body ).  "your picture is already in the body 

lr_receiver = cl_cam_address_bcs=&amp;gt;create_internet_address( 'someone at somewhere . com' ). 
lr_email-&amp;gt;add_recipient( i_recipient = lr_receiver ).

lr_email-&amp;gt;set_send_immediately( 'X' ).
l_send_result = lr_email-&amp;gt;send( i_with_error_screen = 'X' ).

COMMIT WORK.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 12:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722050#M1298247</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-27T12:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722051#M1298248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply, I have tried this code as well. But I have also no clue (and no authorizations) how to handle the MIME repository. And I also prefer the function modules instead the BCS class.&lt;/P&gt;&lt;P&gt;But if have some sample code how to upload images to the MIME repository, you can also convince me to use the BCS class...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Steffen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 13:26:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722051#M1298248</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-27T13:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722052#M1298249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must have authorizaiton to &lt;STRONG&gt;OAER&lt;/STRONG&gt; tcode, then follow these steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- run OAER&lt;/P&gt;&lt;P&gt;- in &lt;EM&gt;Class name&lt;/EM&gt; type &lt;STRONG&gt;PICTURES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- in &lt;EM&gt;Class type&lt;/EM&gt; type &lt;STRONG&gt;OT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- in &lt;EM&gt;Object key&lt;/EM&gt; type &lt;STRONG&gt;MYPICTURE&lt;/STRONG&gt;  &lt;/P&gt;&lt;P&gt;- run it&lt;/P&gt;&lt;P&gt;- from bottom left part of screen choose &lt;EM&gt;Screen&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- pick your image&lt;/P&gt;&lt;P&gt;- as &lt;EM&gt;Description&lt;/EM&gt; put &lt;EM&gt;MYPICTURE&lt;/EM&gt; too&lt;/P&gt;&lt;P&gt;- in code I provided replace&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
wa_query-value = 'ENJOYSAP_LOGO'.

"with
wa_query-value = 'MYPICTURE'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's all you need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 14:06:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722052#M1298249</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-27T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722053#M1298250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are coming closer and closer, thanks a lot!&lt;/P&gt;&lt;P&gt;I thought I have uploaded the image in TA OAER correctly, but unfortunately function WWW_GET_MIME_OBJECT can't find my picture.&lt;/P&gt;&lt;P&gt;When I debug this function, I can see that the call "import mime from database wwwdata(mi) id key."&lt;/P&gt;&lt;P&gt;fails with SUBRC 4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have uploaded the picture in OAER with  these steps&lt;/P&gt;&lt;P&gt;- in Class name type &lt;STRONG&gt;PICTURES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- in Class type type &lt;STRONG&gt;OT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- in Object key type &lt;STRONG&gt;ZSACO_SAP_LOGO_MAIL&lt;/STRONG&gt;  &lt;/P&gt;&lt;P&gt;- run it&lt;/P&gt;&lt;P&gt;- from bottom left part of screen choose Screen&lt;/P&gt;&lt;P&gt;- pick your image&lt;/P&gt;&lt;P&gt;- as Description put ZSACO_SAP_LOGO_MAIL too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and before function WWW_GET_MIME_OBJECT  is called I build the query like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;wa_query-name = '_OBJECT_ID'.
  wa_query-value = 'ZSACO_SAP_LOGO_MAIL'. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function then fails wit SUBRC 3 (=others).&lt;/P&gt;&lt;P&gt;Maybe I have to provide more parameters for thsi functions? At the moment  only the query_string is filled, but there are a lot more:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'WWW_GET_MIME_OBJECT'
    TABLES
      query_string        = it_query
      html                = it_html
      mime                = pick_data
    CHANGING
      return_code         = return_code
      content_type        = content_type
      content_length      = content_length&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be really helpful if you help me with this, I think this is the last step, as the mail is already send out properly, just without the picture...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Steffen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 08:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722053#M1298250</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-28T08:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722054#M1298251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steffen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatelly I was wrong. Using tcode &lt;STRONG&gt;OAER&lt;/STRONG&gt; you can upload pictures only used in ALV background (top-of-page). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using fm &lt;EM&gt;WWW_GET_MIME_OBJECT&lt;/EM&gt; you will have to use &lt;STRONG&gt;SAP Web Repository&lt;/STRONG&gt; (tcode SNWO), but this seems you are missing authorization for. &lt;/P&gt;&lt;P&gt;Anyhow if you are able to access it please check this blog for details how to upload your picture so it will be visible as MIME object&lt;/P&gt;&lt;P&gt;[How to display picture in SAP screen|http://abap-explorer.blogspot.com/2008/10/how-to-display-picture-in-screen.html]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you upload it, the code should work and import from table &lt;EM&gt;wwwdata&lt;/EM&gt; will not fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 18:09:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722054#M1298251</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-28T18:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722055#M1298252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hm, I managed it to upload the image into the Web Repistory and this is the URL which is builded:&lt;/P&gt;&lt;P&gt;"SAPR3://DE4BBB2FAA4798F197D8001438C4EA66". Unfortunately, when putting this into the HTML image tag, I still get a broken image (red cross) in the HTML mail. I have to state that I had the receive the same ID for the image all the time, I mean before I've uploaded it with SMW0. Most likely because I have uploaded it with OAER and SE78.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, FM DP_CREATE_URL returns URL "SAPR3://DE4BBB2FAA4798F197D8001438C4EA66", which seems to be not valid for an image tag. Any idea what might be the issue now?&lt;/P&gt;&lt;P&gt;Could it be that I have to attach the image to the mail object instead of simply use it in the image tag?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, your help is highly appreciated!!! Thanks a lot!&lt;/P&gt;&lt;P&gt;Regards, Steffen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on May 28, 2009 9:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 19:20:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722055#M1298252</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-28T19:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722056#M1298253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Success!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I assumed, when I attach the Pic to the mail and use the attachment name in the image tag, it is working!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the creation of the email document and I have just inserted the ADD_ATTACHMENT method like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lr_email_body = cl_document_bcs=&amp;gt;create_document(
                                   i_type = 'HTM'
                                   i_text = lt_message
                                   i_subject = l_subject ).

  "add attachment to mail 
  lr_email_body-&amp;gt;add_attachment(
            *i_attachment_type* = 'GIF'
            *i_attachment_subject* = 'My_GIF'
            i_att_content_hex = pick_data ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I then create the image tag like below, the pic is displayed correctly in the mail:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ls_message = '&amp;lt;&amp;lt;img src="My_GIF.GIF"&amp;gt;&amp;gt;'.
APPEND ls_message TO lt_message.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You simply have to use the name provided in &lt;STRONG&gt;i_attachment_subject&lt;/STRONG&gt; and the document extenstion coming from &lt;STRONG&gt;i_attachment_type&lt;/STRONG&gt; to build the image source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perfect! Thanks a lot for all your help!!!!!!&lt;/P&gt;&lt;P&gt;It was worth the full points! &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Steffen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on May 28, 2009 9:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 19:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722056#M1298253</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-05-28T19:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722057#M1298254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi...could you please tell in brief, the steps tht u followed to send an image in a mail? I tried going through all the posts, but stll couldn't get the result still..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 10:55:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722057#M1298254</guid>
      <dc:creator>divya_nayudu</dc:creator>
      <dc:date>2009-08-11T10:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722058#M1298255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Upload your pic via transaction SWM0 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Retrieve image&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;wa_query-name = '_OBJECT_ID'.
  wa_query-value = YOUR_NAME. "name in swm0 where your picture was placed

  append wa_query to it_query.


  call function 'WWW_GET_MIME_OBJECT'
    tables
      query_string        = it_query
      html                = it_html
      mime                = pick_data
    changing
      return_code         = return_code
      content_type        = content_type
      content_length      = content_length
    exceptions
      invalid_table       = 1
      parameter_not_found = 2
      others              = 3.
  if sy-subrc = 0.
    pic_size = content_length.
  endif.

  clear url.
  call function 'DP_CREATE_URL'
    exporting
      type     = 'image'
      subtype  = 'X-UNKNOWN'
      size     = pic_size
      lifetime = 'T'
    tables
      data     = pick_data
    changing
      url      = url
    exceptions
      others   = 1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Prepare your HTML mail document. Include the image tag to your pic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;concatenate '&amp;lt;img_src="' your_image '"&amp;gt;' into gv_mail_body.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In my case &lt;/P&gt;&lt;P&gt;your_image = 'sap_logo.gif'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of: (see code below)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;i_attachment_type = 'GIF'
i_attachment_subject = 'sap_logo'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Then BCS class to send your mail, image will be attached&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lr_email type ref to cl_bcs,
        lr_email_body type ref to cl_document_bcs,
        l_send_result type c,
        lr_receiver type ref to if_recipient_bcs,
        l_subject type so_obj_des,
        l_sender type ref to if_sender_bcs,
        l_mail_address type adr6-smtp_addr.



  "l_mail_address LIKE mail_address.
  l_subject = 'SAPCon EM - Inactivity Reminder'.
  lr_email_body = cl_document_bcs=&amp;gt;create_document(
                                   i_type = 'HTM'
                                   i_text = gt_mail_body
                                   i_subject = l_subject ).


  "add attachment to mail (not from Marcin) WORKS!!!!
  lr_email_body-&amp;gt;add_attachment(
            i_attachment_type = 'GIF'
            i_attachment_subject = 'sap_logo'
            i_att_content_hex = pick_data ).



  lr_email = cl_bcs=&amp;gt;create_persistent( ).
  lr_email-&amp;gt;set_document( lr_email_body ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Then add all required recipients and send the mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"Add all recipients
  loop at gt_receiver into gs_receiver.
    l_mail_address = gs_receiver-receiver.

    lr_receiver = cl_cam_address_bcs=&amp;gt;create_internet_address( l_mail_address ).
    lr_email-&amp;gt;add_recipient( i_recipient = lr_receiver ).

  endloop.

  "Set Sender and send mail
  l_sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).
  lr_email-&amp;gt;set_sender( l_sender ).
  lr_email-&amp;gt;set_send_immediately( 'X' ).  "Sed email directly
  l_send_result = lr_email-&amp;gt;send( i_with_error_screen = 'X' ).

  commit work.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this help???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't tell you what's wrong with the format, it is totally corrupted. If you want, post your email, and I will mail you the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Steffen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on Aug 11, 2009 1:35 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on Aug 11, 2009 1:36 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on Aug 11, 2009 1:37 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on Aug 11, 2009 2:04 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Steffen Weber on Aug 11, 2009 2:06 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 11:35:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722058#M1298255</guid>
      <dc:creator>steffen_weber</dc:creator>
      <dc:date>2009-08-11T11:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722059#M1298256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ms. Weber,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You said: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the creation of the email document and I have just inserted the ADD_ATTACHMENT method like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lr_email_body = cl_document_bcs=&amp;gt;create_document(&lt;/P&gt;&lt;P&gt;                                   i_type = 'HTM'&lt;/P&gt;&lt;P&gt;                                   i_text = lt_message&lt;/P&gt;&lt;P&gt;                                   i_subject = l_subject ).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  "add attachment to mail &lt;/P&gt;&lt;P&gt;  lr_email_body-&amp;gt;add_attachment(&lt;/P&gt;&lt;P&gt;            &lt;STRONG&gt;i_attachment_type&lt;/STRONG&gt; = 'GIF'&lt;/P&gt;&lt;P&gt;            &lt;STRONG&gt;i_attachment_subject&lt;/STRONG&gt; = 'My_GIF'&lt;/P&gt;&lt;P&gt;            i_att_content_hex = pick_data ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I then create the image tag like below, the pic is displayed correctly in the mail:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_message = '&amp;lt;&amp;lt;img src="My_GIF.GIF"&amp;gt;&amp;gt;'.&lt;/P&gt;&lt;P&gt;APPEND ls_message TO lt_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this to my requirement but it did not work.&lt;/P&gt;&lt;P&gt;The image is not still displayed, though it is properly attached.&lt;/P&gt;&lt;P&gt;I want it to be displayed on the body of the email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me what further steps you made for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ronnie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2010 14:28:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722059#M1298256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-25T14:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722060#M1298257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your post.. it helped my problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2011 16:28:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722060#M1298257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-21T16:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722061#M1298258</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 the same problem: how to send an image via email but in the BODY not like an attach file. &lt;/P&gt;&lt;P&gt;I read this post and I tried the steps. Yes, you can do this but like an attach file. If you want to put the image in the body of the email, first the &lt;STRONG&gt;image should be located&lt;/STRONG&gt; &lt;STRONG&gt;on a server&lt;/STRONG&gt; which can be hit threw the internet(if this email is to go outside your network). Next, use HTML to build your email body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also found  the &lt;STRONG&gt;Note 416340 - Personalized e-mails: No graphics sent&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mihaela&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2011 08:16:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722061#M1298258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-06T08:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722062#M1298259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes the image should be loaded on the server which can be accessed outside as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can load the image through web repository SWM0 or SE78 as you like. and accordingly create the graphic_table for that image through the FMs mentioned in the post and pass it as an attached file(internal table) in the email FM (Graphic_table is passed as attachement but the image in the email will be in BODY only along with Image attachment). I have tried and it works for me on gmail , my company mail etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is helpful. &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Varsha Agarwal on Jul 6, 2011 6:59 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2011 16:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722062#M1298259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-06T16:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722063#M1298260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Varsha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have the same requirement. But, when I tried the steps mentioned in the post, I can only see the image in attachment but not in the body of the mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the cl_bcs class only to send the mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible, please post your code, so that it could be very helpful for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2012 13:25:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722063#M1298260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-02T13:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Send HTML mail with image</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722064#M1298261</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 am also trying to send the image in the mail body but the image is not being displayed in the mail.&lt;/P&gt;&lt;P&gt;I am using cl_bcs class to send the image as the attachment in the mail and the body content but the&lt;/P&gt;&lt;P&gt;image is not being displayed instead all I can see a box with red cross however, the attached gets open.&lt;/P&gt;&lt;P&gt;But it is not able to find the image source I guess.&lt;/P&gt;&lt;P&gt;I am using Lotus notes to check the mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am uploading the image file from desktop into my code then I am attaching it in the mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know the solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows :&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------" /&gt;&lt;P&gt; - - - - -- - - - - - - -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ztest_mail_544.&lt;/P&gt;&lt;P&gt;DATA: l_send_request         TYPE REF TO cl_bcs,&lt;/P&gt;&lt;P&gt;        l_document             TYPE REF TO cl_document_bcs,&lt;/P&gt;&lt;P&gt;        l_sender               TYPE REF TO cl_sapuser_bcs,&lt;/P&gt;&lt;P&gt;        l_sub                  TYPE char50,&lt;/P&gt;&lt;P&gt;        l_recipient            TYPE REF TO if_recipient_bcs,&lt;/P&gt;&lt;P&gt;        tl_contents            TYPE STANDARD TABLE OF soli,&lt;/P&gt;&lt;P&gt;        tl_reciev              TYPE STANDARD TABLE OF somlreci1,&lt;/P&gt;&lt;P&gt;        lp_encrypt             TYPE bcsd_encr,&lt;/P&gt;&lt;P&gt;        wa_contents            TYPE solisti1,&lt;/P&gt;&lt;P&gt;        l_doc_len              TYPE so_obj_len,&lt;/P&gt;&lt;P&gt;        l_cnt                  TYPE sy-tabix,&lt;/P&gt;&lt;P&gt;        l_rcv_email            TYPE adr6-smtp_addr,&lt;/P&gt;&lt;P&gt;        l_result               TYPE sy-binpt,&lt;/P&gt;&lt;P&gt;        l_bcs_exception        TYPE REF TO cx_bcs,&lt;/P&gt;&lt;P&gt;        l_subj                 TYPE string,&lt;/P&gt;&lt;P&gt;        l_doc                  TYPE REF TO cl_document_bcs,&lt;/P&gt;&lt;P&gt;        e_result               TYPE sr_state,&lt;/P&gt;&lt;P&gt;        ls_receivers           TYPE somlreci1,&lt;/P&gt;&lt;P&gt;        ll_text                TYPE uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA filename TYPE string .&lt;/P&gt;&lt;P&gt;DATA : it_tab TYPE solix_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename = 'C:\Documents and Settings\Desktop\otter.jpg'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    filename                      = filename&lt;/P&gt;&lt;P&gt;    filetype                      = 'BIN'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    data_tab                      = it_tab&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   file_open_error               = 1&lt;/P&gt;&lt;P&gt;   file_read_error               = 2&lt;/P&gt;&lt;P&gt;   no_batch                      = 3&lt;/P&gt;&lt;P&gt;   gui_refuse_filetransfer       = 4&lt;/P&gt;&lt;P&gt;   invalid_type                  = 5&lt;/P&gt;&lt;P&gt;   no_authority                  = 6&lt;/P&gt;&lt;P&gt;   unknown_error                 = 7&lt;/P&gt;&lt;P&gt;   bad_data_format               = 8&lt;/P&gt;&lt;P&gt;   header_not_allowed            = 9&lt;/P&gt;&lt;P&gt;   separator_not_allowed         = 10&lt;/P&gt;&lt;P&gt;   header_too_long               = 11&lt;/P&gt;&lt;P&gt;   unknown_dp_error              = 12&lt;/P&gt;&lt;P&gt;   access_denied                 = 13&lt;/P&gt;&lt;P&gt;   dp_out_of_memory              = 14&lt;/P&gt;&lt;P&gt;   disk_full                     = 15&lt;/P&gt;&lt;P&gt;   dp_timeout                    = 16&lt;/P&gt;&lt;P&gt;   OTHERS                        = 17&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;wa_contents-line = 'Mail containing pics &amp;lt;br/&amp;gt;'.&lt;/P&gt;&lt;P&gt;APPEND wa_contents TO tl_contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR wa_contents.&lt;/P&gt;&lt;P&gt;wa_contents-line = '&amp;lt;p&amp;gt;&amp;lt;img src="otter.jpg" width="304" height="228"&amp;gt;&amp;lt;/img &amp;gt; &amp;lt;/p&amp;gt;&amp;lt;br/&amp;gt;'.&lt;/P&gt;&lt;P&gt;APPEND wa_contents TO tl_contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;*-- Create persistent send request&lt;/P&gt;&lt;P&gt;    l_send_request = cl_bcs=&amp;gt;create_persistent( ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       tl_contents[] = it_mail_body[].&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Get the length of the Document&lt;/P&gt;&lt;P&gt;    DESCRIBE TABLE tl_contents LINES l_cnt.&lt;/P&gt;&lt;P&gt;    READ TABLE tl_contents INTO wa_contents INDEX l_cnt.&lt;/P&gt;&lt;P&gt;    l_doc_len = ( l_cnt - 1 ) * 255 + STRLEN( wa_contents ).&lt;/P&gt;&lt;P&gt;*-- Subject of the mail&lt;/P&gt;&lt;P&gt;    CLEAR l_sub.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_sub = 'test mail for image'.&lt;/P&gt;&lt;P&gt;    l_document = cl_document_bcs=&amp;gt;create_document(&lt;/P&gt;&lt;P&gt;                 i_type       = 'HTM'&lt;/P&gt;&lt;P&gt;                 i_text       = tl_contents&lt;/P&gt;&lt;P&gt;                 i_length     = l_doc_len&lt;/P&gt;&lt;P&gt;                 i_subject    = l_sub&lt;/P&gt;&lt;P&gt;                 i_language   = sy-langu&lt;/P&gt;&lt;P&gt;                 i_importance = '9' ).&lt;/P&gt;&lt;P&gt;*-- Add document to send request&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;set_document( l_document ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Don't send delivery info for successful mails&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;set_status_attributes&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_requested_status = 'E'&lt;/P&gt;&lt;P&gt;        i_status_mail      = 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Set sender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_sender = cl_sapuser_bcs=&amp;gt;create( 'HR_SUPPORT' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;set_sender&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_sender = l_sender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA : i_attachment_type    TYPE  soodk-objtp,&lt;/P&gt;&lt;P&gt;           i_attachment_subject TYPE  sood-objdes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA : t_attachment TYPE STANDARD TABLE OF  solix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRY.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       l_att_type = i_attachment_type.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       l_subject  = i_attachment_subject.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        i_attachment_type = 'jpg'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        t_attachment[] = it_tab[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        l_doc = l_document .&lt;/P&gt;&lt;P&gt;        i_attachment_type = space.&lt;/P&gt;&lt;P&gt;        i_attachment_subject = 'otter.jpg'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL METHOD l_doc-&amp;gt;add_attachment&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            i_attachment_type    = i_attachment_type&lt;/P&gt;&lt;P&gt;            i_attachment_subject = i_attachment_subject&lt;/P&gt;&lt;P&gt;            i_att_content_hex    = t_attachment.&lt;/P&gt;&lt;P&gt;      CATCH cx_document_bcs.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_recipient = cl_cam_address_bcs=&amp;gt;create_internet_address('xyz @abc.com' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;add_recipient&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_recipient  = l_recipient&lt;/P&gt;&lt;P&gt;        i_express    = 'X'&lt;/P&gt;&lt;P&gt;        i_copy       = ''&lt;/P&gt;&lt;P&gt;        i_blind_copy = ''.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;set_send_immediately( 'X' ).&lt;/P&gt;&lt;P&gt;*-- Send Email&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;send(&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_with_error_screen = 'X'&lt;/P&gt;&lt;P&gt;        RECEIVING&lt;/P&gt;&lt;P&gt;          result              = l_result ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    COMMIT WORK.&lt;/P&gt;&lt;P&gt;  CATCH cx_bcs INTO l_bcs_exception.&lt;/P&gt;&lt;P&gt;    write : 'mail not sent '.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2012 11:06:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-html-mail-with-image/m-p/5722064#M1298261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-13T11:06:16Z</dc:date>
    </item>
  </channel>
</rss>

