Enterprise Resource Planning Portal ERPGenie.COM Enterprise Resource Planning Portal

   Advertise | BLOG

Web ERPGenie.COM

Home | Vote for us |

ERPGenie.COM -> SAP Technical -> ABAP -> Example code -> Sending an HTML EMail from ABAP

report zemail no standard page heading line-size 220.

data: message_content like soli occurs 10 with header line,
        receiver_list like soos1 occurs 5 with header line,
        w_object_hd_change like sood1.

start-of-selection.

* Receivers
receiver_list-recextnam = 'dude@domain.com'.
receiver_list-recesc = 'E'.
receiver_list-sndart = 'INT'
receiver_list-sndpri = '1'.
append receiver_list.

* General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
w_object_hd_change-file_ext = 'HTM'. "<--this is important

* Mail subject
w_object_hd_change-objdes = 'HTML from SAP/ABAP'.

* Mail body
append 'Message content' to message_content.
append '<b>How''s this for sending HTML E-mail from SAP?</b>' to
message_content.
append '<p>New paragraph</p>' to message_content.
append '<p>Apostrophe&#8217s</p>' to message_content.

* Call function to send email - SAPConnect needs to be configured
call function 'SO_OBJECT_SEND'
  exporting
      object_hd_change = w_object_hd_change
      object_type = 'RAW'
      owner = sy-uname
  tables
      objcont = message_content
      receivers = receiver_list.

Contact Us | Polls | Add URL | Contribute | About | Privacy | Terms | Feedback | Help!

Message Board | Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job