Embedding Image in mail body instead of sending it as an attachment

...Previous

Step 6: Send Mail.

           DATA : lt_mail_body TYPE soli_tab,
         lwa_mail_body 
LIKE LINE OF lt_mail_body.

  l_subject = 
'Test : Image in mail'.

  lr_email_body = cl_document_bcs=>create_document(
                                   i_type = 
'HTM'
                                   i_text = gt_mail_body
                                   i_subject = l_subject ).

  lr_email = cl_bcs=>create_persistent( ).
  lr_email->set_document( lr_email_body ).

  l_mail_address = 
'test@test.com'.

  lr_receiver = cl_cam_address_bcs=>create_internet_address( l_mail_address ).
  lr_email->add_recipient( i_recipient = lr_receiver ).

  
"Set Sender and send mail
  l_sender = cl_sapuser_bcs=>create( sy-uname ).
  lr_email->set_sender( l_sender ).
  lr_email->set_send_immediately( 
'X' ).  "Send email directly
  l_send_result = lr_email->send( i_with_error_screen = 
'X' ).

  
COMMIT WORK.

Output:

Go to SAP inbox

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image