HTML in email body

Hi,
    Can someone please let me know how can I send a email with formatted body. I am planning to use HTML for formatting.
    I am using the method
cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = html
i_length = conlengths
i_subject = subject ).
This is not working. However I am able to attach HTML file to the mail .
Thanks and regards,
Vamsi

Hi Mohana,
Please use the below FM first to convert raw text to HTML and then append the html data to final FM.
Please check the below piece of code which we have used and its working.
Header record for converting to HTML
  ls_header-tdname   = zemailtxt.
  ls_header-tdspras  =  'E'.
  ls_header-tdid     =  'ST'.
  ls_header-tdobject =  'TEXT'.
  ls_header-tdstyle  =  'system'.
FM to convert SAP script to HTML
  CALL FUNCTION 'CONVERT_ITF_TO_HTML'
    EXPORTING
      i_header       = ls_header
    TABLES
      t_itf_text     = lt_lines
      t_html_text    = lt_html
    EXCEPTIONS
      syntax_check   = 1
      replace        = 2
      illegal_header = 3
      OTHERS         = 4.
  REFRESH gt_content.
Populate email body to an internal table
  LOOP AT lt_html INTO ls_html.
    lwa_content = ls_html-tdline.
    APPEND lwa_content TO gt_content.
    CLEAR lwa_content.
  ENDLOOP.
Populate the packing details of Mail body
  CLEAR : gv_lines.
  DESCRIBE TABLE gt_content LINES gv_lines.
  lwa_objpack-head_start = 1.
  lwa_objpack-head_num   = 0.
  lwa_objpack-body_start = 1.
  lwa_objpack-body_num   = gv_lines.
  lwa_objpack-doc_type   = 'HTM'.
  APPEND lwa_objpack TO lit_objpack.
-- Some code for header and doc size ..
*-- FM for sending email to NERC Team,
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
      EXPORTING
        document_data              = gs_doc_chng
        put_in_outbox              =  'X'
        sender_address             = lv_sender_mail
        sender_address_type        = lv_add_type
        commit_work                = gc_x
      TABLES
        packing_list               = lit_objpack
        contents_txt               = gt_content
        receivers                  = gt_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.                                    
    ENDIF.

Similar Messages

  • Email bursting send report as HTML in email body

    Hello,
    I have Oracle BI Publisher 10.1.3.4.1 (build# 1101) version installed as part of Oracle Business Inteligence.
    I have question about email bursting. I created simple report and I am bursting it via email. But I would like to send report in HTML as part of email body and not as attachment. I read that it is possible in other versions of BIP (as part of EBS) with using of bursting configuration file. But I can not use this file with my version of BIP, I can configure bursting only vie SQL query.
    Is there any solution?
    Thank you

    My bursting SQL query:
    SELECT DISTINCT
    ip.APPL_ID KEY,
    '11F_Search_Prospect_Email' TEMPLATE,
    'RTF' template_format,
    'en-US' locale,
    'HTML' output_format,
    'EMAIL' DEL_CHANNEL,
    ip.email PARAMETER1,
    '[email protected]' PARAMETER3,
    'Welcome' PARAMETER4,
    'true' PARAMETER6
    FROM ugrad.inquiry_prospect ip,
    ugrad.correspondence f,
    ugrad.address e,
    ugrad.f_lookup fl
    WHERE ip.appl_id = f.appl_id
    AND ip.APPL_ID = e.APPL_ID
    AND fl.TYPE_CODE='C'
    AND ip.record_stage = 'Prospect'
    AND e.COUNTRY_CODE=fl.code
    AND e.table_name = 'INQUIRY_PROSPECT'
    AND e.address_type =
    NVL ((SELECT gg.address_type
    FROM ugradadm.address gg
    WHERE gg.address_type =
    DECODE (f.mailpref,
    'Home', 'HOME',
    'Best', 'LOCAL',
    'HOME'
    AND gg.table_name = 'INQUIRY_PROSPECT'
    AND gg.APPL_ID = ip.appl_id
    AND((gg.address_type='LOCAL' AND NVL(gg.address_expir_date,sysdate)>sysdate)
    OR gg.address_type='HOME')),
    'HOME'
    AND f.batchid = :Batch_ID
    This report when bursted sends an email with the layout template as html body.
    The EMAIL configuration is set with a server Port number and its host address.

  • Smartforms output as HTML in email

    Hi,
    I want to send the output of a smartform as html in email body.
    I found and used this bolg: :<a href="/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp HTML Email from SAP CRM/ERP</a>
    I did everything as per the blog.
    However I am getting the email as:
    sf @media print {.xsfnoprint{ display : none ;}}/* Default css layout information for SAP Smart Forms (XSF Output) Last modified: 12.05.2003 /@media screen { body { background-color : #EFEFEF ; }}@media screen { .page { border-style : outset ; border-width : 2pt ; background-color : white ; }}/@media print { .page { overflow: hidden; }}// unification browser-dependent settings /table { border-spacing: 0pt; empty-cells: show;}tr { vertical-align: top; }td input img img.icon / End of default.css */.SYSTEM div#B.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : justify ; clear : both ;}.SYSTEM div#L.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : left ; clear : both ;}.SYSTEM a.SYSTEM span#H.char{ font-weight : bold ;}.SYSTEM span#I.char{ font-style : italic ;}.SYSTEM span#U.char{ text-decoration : underline ;}#sfPAGE1-001.page@media screen {#MAIN.win{ overflow : auto ;}}@media print {#MAIN.win{ overflow : hidden ;}}#sfPAGE1-001.page #MAIN.win
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    I am using: Lotus notes client for email and my smartform contains only two text elements: one containing text Welcome and other containing text
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    When I display the document using SOST, I get the output as
    Address bar has this:  C:\Documents and Settings\EDC LTIL02\SapWorkDir\TESTHTMLEMAILFROMSMARTFORMOUTPUT_20070928154506.046_X.MHT
    and window contains:
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48"> "
    Regards,
    Reema
    Message was edited by:
            Reema Shahbazkar
    In case anyone needs to have a look at my code:
    REPORT  ZSMARTFORM_2_HTML_EMAIL.
    get generated function module for the smartform
    DATA: FM_NAME TYPE RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'ZSF_SAMPLE_HTML'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
       FM_NAME                  = FM_NAME
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    get smartform contetnt
    set smartform output options
    data:
      control_parameters type SSFCTRLOP,
      OUTPUT_OPTIONS     TYPE SSFCOMPOP,
      DOCUMENT_OUTPUT_INFO  TYPE SSFCRESPD,
      JOB_OUTPUT_INFO  TYPE SSFCRESCL,
      JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
      XSFPARAM_LINE TYPE SSFXSFP,
      P_HTML TYPE TRFRESULT,
      P_GRAPHICS TYPE TSF_XSF_GR,
      WA_RETURN TYPE BAPIRET2.
    CONSTANTS: C_GR_DIR TYPE TDTEXT VALUE '/MYGRAPHICS'.
    control_parameters-NO_DIALOG = 'X'.
    *control_parameters-GETOTF = 'X'.
    OUTPUT_OPTIONS-TDNEWID = SPACE.
    OUTPUT_OPTIONS-TDIMMED = SPACE.
    OUTPUT_OPTIONS-XSFCMODE = 'X'.  "RUNTIME SETTINGS FROM SMARTFORM HEADER TO BE USED
    OUTPUT_OPTIONS-XSF = 'X'.  "XSF OUTPUT ACTIVATED
    OUTPUT_OPTIONS-XSFOUTMODE = 'A'.  "XSF OUTPUT STREAM PASSED DIRECTLY TO CALLING PROGRAM AS AN INTERNAL TABLE.
    CLEAR: OUTPUT_OPTIONS-XSFOUTDEV.  "OUTPUT SPOOL DEVICE
    OUTPUT_OPTIONS-XSFFORMAT = 'X'.  "ADDITIONALLLY TO XSF, HTML AND CSS LAYOUT INFORMATION IS ALSO PASSED TO CALLING PROGRAM
    XSFPARAM_LINE-NAME = 'GRAPHICS'.
    XSFPARAM_LINE-VALUE = 'EXTRACT'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'GRAPHICS-DIRECTORY'.
    XSFPARAM_LINE-VALUE = C_GR_DIR.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'CONTENT-ID'.
    XSFPARAM_LINE-VALUE = 'ENABLE'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    CALL GENERATED FUNCTION MODULE TO GET FORM CONTENTS
    CALL FUNCTION FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
    IMPORTING
       DOCUMENT_OUTPUT_INFO       = DOCUMENT_OUTPUT_INFO
       JOB_OUTPUT_INFO            = JOB_OUTPUT_INFO
       JOB_OUTPUT_OPTIONS         = JOB_OUTPUT_OPTIONS
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 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.
    SEPARATE HTML GRAPHICAL N CSS LAYOUT CONTENT
    P_HTML = JOB_OUTPUT_INFO-XMLOUTPUT-TRFRESULT.
    P_GRAPHICS[] = JOB_OUTPUT_INFO-XMLOUTPUT-XSFGR[].
    PROCEED TO SEND EMAIL
    DATA: HTML_DATA TYPE TRFRESULT,
          L_HTML_RAW LIKE LINE OF HTML_DATA-CONTENT,
          HTML_XSTR TYPE XSTRING.
    CLEAR: HTML_XSTR.
    LOOP AT P_HTML-CONTENT INTO L_HTML_RAW.
      CONCATENATE HTML_XSTR L_HTML_RAW INTO HTML_XSTR IN BYTE MODE.
    ENDLOOP.
    HTML_XSTR = HTML_XSTR(P_HTML-LENGTH).
    SPECIAL CHARACTER CONVERSION
    DATA: HTML_STR TYPE STRING,
          HTML_LEN TYPE I.
    CALL FUNCTION 'SCP_TRANSLATE_CHARS'
      EXPORTING
        INBUFF                   = HTML_XSTR
      INBUFFLG                 = 0
       INCODE                   = '4110'  "utf-8
      OUTBUFFLG                = 0
      OUTCODE                  = '0000'
       CSUBST                   = 'X'
      SUBSTC_HASH              = ' '
      SUBSTC_DOT               = ' '
       SUBSTC_SPACE             = 'x'
      SUBSTC                   = '00035'
    IMPORTING
      INUSED                   =
       OUTBUFF                  = HTML_STR
      OUTOVERFLOW              =
       OUTUSED                  = HTML_LEN
      SUBSTED                  =
      INPUT_ENDS_IN_CHAR       =
      ERRMSG                   =
    EXCEPTIONS
      INVALID_CODEPAGE         = 1
      INTERNAL_ERROR           = 2
      CANNOT_CONVERT           = 3
      FIELDS_BAD_TYPE          = 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.
    CHANGE ENCODING UTF-8 TO LATIN1
    REPLACE ALL OCCURRENCES OF 'UTF-8' IN HTML_STR WITH 'iso-8859-1' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<IMG' IN HTML_STR WITH '<IMG' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '/>' IN HTML_STR WITH '/>' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<A>' IN HTML_STR WITH '' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<' IN HTML_STR WITH '<' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '>' IN HTML_STR WITH '>' IGNORING CASE.
    HTML_LEN = STRLEN( HTML_STR ).
    DATA: L_OFFSET TYPE I,
          L_LENGTH TYPE I,
          L_DIFF TYPE I,
          LT_SOLI TYPE SOLI_TAB,
          LS_SOLI TYPE SOLI.
    L_OFFSET = 0.
    L_LENGTH = 255.
    WHILE L_OFFSET < HTML_LEN.
      L_DIFF = HTML_LEN - L_OFFSET.
      IF L_DIFF > L_LENGTH.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_LENGTH).
      ELSE.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_DIFF).
      ENDIF.
      APPEND LS_SOLI TO LT_SOLI.
      ADD L_LENGTH TO L_OFFSET.
    ENDWHILE.
    DATA: LO_MIME_HELPER TYPE REF TO CL_GBT_MULTIRELATED_SERVICE.
    CREATE OBJECT LO_MIME_HELPER
      EXPORTING
        CODEPAGE = '1133'.
    CALL METHOD LO_MIME_HELPER->SET_MAIN_HTML
      EXPORTING
        CONTENT     = LT_SOLI
       FILENAME    =
       DESCRIPTION =
    HANDLE GRAPHICS
    DATA: L_GRAPHIC TYPE SSF_XSF_GR,
          GR_XSTR TYPE XSTRING,
          L_GR_RAW TYPE BAPICONTEN,
          L_CONTENT_ID TYPE STRING,
          L_CONTENT_TYPE TYPE W3CONTTYPE,
          L_OBJ_LEN TYPE SO_OBJ_LEN,
          L_FILENAME TYPE STRING,
          LT_SOLIX TYPE SOLIX_TAB,
          LS_SOLIX TYPE SOLIX.
    LOOP AT P_GRAPHICS INTO L_GRAPHIC.
      CLEAR: GR_XSTR.
      LOOP AT L_GRAPHIC-CONTENT INTO L_GR_RAW.
        CONCATENATE GR_XSTR L_GR_RAW-LINE INTO GR_XSTR IN BYTE MODE.
      ENDLOOP.
      GR_XSTR = GR_XSTR(L_GRAPHIC-LENGTH).
      L_OFFSET = 0.
      L_LENGTH = 255.
      CLEAR LT_SOLIX[].
      WHILE L_OFFSET < L_GRAPHIC-LENGTH.
        L_DIFF = L_GRAPHIC-LENGTH - L_OFFSET.
        IF L_DIFF > L_LENGTH.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_LENGTH).
        ELSE.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_DIFF).
        ENDIF.
        APPEND LS_SOLIX TO LT_SOLIX.
        ADD L_LENGTH TO L_OFFSET.
      ENDWHILE.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_FILENAME.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_CONTENT_ID.
      L_CONTENT_TYPE = L_GRAPHIC-HTTPTYPE.
      L_OBJ_LEN = L_GRAPHIC-LENGTH.
    ADD IMAGES TO EMAIL
      CALL METHOD LO_MIME_HELPER->ADD_BINARY_PART
        EXPORTING
          CONTENT      = LT_SOLIX
         FILENAME     =
         EXTENSION    =
         DESCRIPTION  =
          CONTENT_TYPE = L_CONTENT_TYPE
          LENGTH       = L_OBJ_LEN
          CONTENT_ID   = L_CONTENT_ID
    ENDLOOP.
    DATA: LO_DOC_BCS TYPE REF TO CL_DOCUMENT_BCS,
          P_SUBJECT TYPE SO_OBJ_DES,
          LV_GBT_MIME TYPE REF TO CX_GBT_MIME,
          LV_BCOM_MIME TYPE REF TO CX_BCOM_MIME,
          LV_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS.
      P_SUBJECT = 'TEST HTML EMAIL FROM SMARTFORM OUTPUT'.
      TRY.
      CALL METHOD CL_DOCUMENT_BCS=>CREATE_FROM_MULTIRELATED
        EXPORTING
          I_SUBJECT          = P_SUBJECT
          I_LANGUAGE         = SY-LANGU
          I_IMPORTANCE       = '5'
          I_SENSITIVITY      = 'F'
          I_MULTIREL_SERVICE = LO_MIME_HELPER
        RECEIVING
          RESULT             = LO_DOC_BCS
       CATCH CX_DOCUMENT_BCS INTO LV_DOCUMENT_BCS.
       CATCH CX_BCOM_MIME INTO LV_BCOM_MIME.
       CATCH CX_GBT_MIME INTO LV_GBT_MIME.
      ENDTRY.
    RECEIVERS
    DATA: P_RECEIVERS TYPE TABLE OF SOMLRECI1,
          RECEIVER TYPE SOMLRECI1,
          L_MAIL_ADDRESS TYPE AD_SMTPADR,
          LO_BCS TYPE REF TO CL_BCS,
          LV_SEND_REQ_BCS TYPE REF TO CX_SEND_REQ_BCS,
          L_USERNAME TYPE UNAME,
          SEND_PARTNER TYPE BU_PARTNER,
          LI_SENDER TYPE REF TO IF_SENDER_BCS,
          LV_ADDRESS_BCS TYPE REF TO CX_ADDRESS_BCS,
          LV_SENT_TO_ALL TYPE BOOLEAN.
    CLEAR RECEIVER.
    RECEIVER-RECEIVER = '[email protected]'.
    RECEIVER-REC_TYPE = 'U'.
    RECEIVER-COM_TYPE = 'INT'.
    APPEND RECEIVER TO P_RECEIVERS.
    L_USERNAME = SY-UNAME.
    CLEAR RECEIVER.
    LOOP AT P_RECEIVERS INTO RECEIVER.
      L_MAIL_ADDRESS = RECEIVER-RECEIVER.
      TRY.
      CALL METHOD CL_BCS=>CREATE_PERSISTENT
        RECEIVING
          RESULT = LO_BCS
       CALL METHOD LO_BCS->SET_DOCUMENT
         EXPORTING
           I_DOCUMENT = LO_DOC_BCS
       CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
      ENDTRY.
    CREATE SENDER
    CLASS CL_CAM_ADDRESS_BCS DEFINITION LOAD.
    TRY.
      IF L_USERNAME NS '@'.
        L_USERNAME = SEND_PARTNER.
        TRANSLATE L_USERNAME TO UPPER CASE.
        LI_SENDER ?= CL_SAPUSER_BCS=>CREATE( L_USERNAME ).
      ELSE.
        DATA: L_FROM_MAIL_ADDRESS TYPE AD_SMTPADR.
        L_FROM_MAIL_ADDRESS = L_USERNAME.
        LI_SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( I_ADDRESS_STRING = L_FROM_MAIL_ADDRESS ).
      ENDIF.
      CALL METHOD LO_BCS->SET_SENDER
        EXPORTING
          I_SENDER = LI_SENDER
    CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    create recepient
    data: LO_RECEPIENT TYPE REF TO IF_RECIPIENT_BCS.
    TRY.
    CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
       EXPORTING
         I_ADDRESS_STRING = L_MAIL_ADDRESS
        I_ADDRESS_NAME   =
        I_INCL_SAPUSER   =
       RECEIVING
         RESULT           = LO_RECEPIENT
      CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    ENDTRY.
    TRY.
    CALL METHOD LO_BCS->ADD_RECIPIENT
       EXPORTING
         I_RECIPIENT  = LO_RECEPIENT
        I_EXPRESS    =
        I_COPY       =
        I_BLIND_COPY =
        I_NO_FORWARD =
      CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    SEND EMAIL DOCUMENT
    TRY.
    CALL METHOD LO_BCS->SEND_REQUEST->SET_REQUESTED_STATUS
      EXPORTING
        I_REQUESTED_STATUS = 'N'
    TRY.
    CALL METHOD LO_BCS->SEND
    EXPORTING
       I_WITH_ERROR_SCREEN = SPACE
      RECEIVING
        RESULT              = LV_SENT_TO_ALL
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    ENDTRY.
    ENDLOOP.
    COMMIT WORK.

    Hi,
    I want to send the output of a smartform as html in email body.
    I found and used this bolg: :<a href="/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp HTML Email from SAP CRM/ERP</a>
    I did everything as per the blog.
    However I am getting the email as:
    sf @media print {.xsfnoprint{ display : none ;}}/* Default css layout information for SAP Smart Forms (XSF Output) Last modified: 12.05.2003 /@media screen { body { background-color : #EFEFEF ; }}@media screen { .page { border-style : outset ; border-width : 2pt ; background-color : white ; }}/@media print { .page { overflow: hidden; }}// unification browser-dependent settings /table { border-spacing: 0pt; empty-cells: show;}tr { vertical-align: top; }td input img img.icon / End of default.css */.SYSTEM div#B.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : justify ; clear : both ;}.SYSTEM div#L.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : left ; clear : both ;}.SYSTEM a.SYSTEM span#H.char{ font-weight : bold ;}.SYSTEM span#I.char{ font-style : italic ;}.SYSTEM span#U.char{ text-decoration : underline ;}#sfPAGE1-001.page@media screen {#MAIN.win{ overflow : auto ;}}@media print {#MAIN.win{ overflow : hidden ;}}#sfPAGE1-001.page #MAIN.win
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    I am using: Lotus notes client for email and my smartform contains only two text elements: one containing text Welcome and other containing text
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    When I display the document using SOST, I get the output as
    Address bar has this:  C:\Documents and Settings\EDC LTIL02\SapWorkDir\TESTHTMLEMAILFROMSMARTFORMOUTPUT_20070928154506.046_X.MHT
    and window contains:
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48"> "
    Regards,
    Reema
    Message was edited by:
            Reema Shahbazkar
    In case anyone needs to have a look at my code:
    REPORT  ZSMARTFORM_2_HTML_EMAIL.
    get generated function module for the smartform
    DATA: FM_NAME TYPE RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'ZSF_SAMPLE_HTML'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
       FM_NAME                  = FM_NAME
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    get smartform contetnt
    set smartform output options
    data:
      control_parameters type SSFCTRLOP,
      OUTPUT_OPTIONS     TYPE SSFCOMPOP,
      DOCUMENT_OUTPUT_INFO  TYPE SSFCRESPD,
      JOB_OUTPUT_INFO  TYPE SSFCRESCL,
      JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
      XSFPARAM_LINE TYPE SSFXSFP,
      P_HTML TYPE TRFRESULT,
      P_GRAPHICS TYPE TSF_XSF_GR,
      WA_RETURN TYPE BAPIRET2.
    CONSTANTS: C_GR_DIR TYPE TDTEXT VALUE '/MYGRAPHICS'.
    control_parameters-NO_DIALOG = 'X'.
    *control_parameters-GETOTF = 'X'.
    OUTPUT_OPTIONS-TDNEWID = SPACE.
    OUTPUT_OPTIONS-TDIMMED = SPACE.
    OUTPUT_OPTIONS-XSFCMODE = 'X'.  "RUNTIME SETTINGS FROM SMARTFORM HEADER TO BE USED
    OUTPUT_OPTIONS-XSF = 'X'.  "XSF OUTPUT ACTIVATED
    OUTPUT_OPTIONS-XSFOUTMODE = 'A'.  "XSF OUTPUT STREAM PASSED DIRECTLY TO CALLING PROGRAM AS AN INTERNAL TABLE.
    CLEAR: OUTPUT_OPTIONS-XSFOUTDEV.  "OUTPUT SPOOL DEVICE
    OUTPUT_OPTIONS-XSFFORMAT = 'X'.  "ADDITIONALLLY TO XSF, HTML AND CSS LAYOUT INFORMATION IS ALSO PASSED TO CALLING PROGRAM
    XSFPARAM_LINE-NAME = 'GRAPHICS'.
    XSFPARAM_LINE-VALUE = 'EXTRACT'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'GRAPHICS-DIRECTORY'.
    XSFPARAM_LINE-VALUE = C_GR_DIR.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'CONTENT-ID'.
    XSFPARAM_LINE-VALUE = 'ENABLE'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    CALL GENERATED FUNCTION MODULE TO GET FORM CONTENTS
    CALL FUNCTION FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
    IMPORTING
       DOCUMENT_OUTPUT_INFO       = DOCUMENT_OUTPUT_INFO
       JOB_OUTPUT_INFO            = JOB_OUTPUT_INFO
       JOB_OUTPUT_OPTIONS         = JOB_OUTPUT_OPTIONS
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 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.
    SEPARATE HTML GRAPHICAL N CSS LAYOUT CONTENT
    P_HTML = JOB_OUTPUT_INFO-XMLOUTPUT-TRFRESULT.
    P_GRAPHICS[] = JOB_OUTPUT_INFO-XMLOUTPUT-XSFGR[].
    PROCEED TO SEND EMAIL
    DATA: HTML_DATA TYPE TRFRESULT,
          L_HTML_RAW LIKE LINE OF HTML_DATA-CONTENT,
          HTML_XSTR TYPE XSTRING.
    CLEAR: HTML_XSTR.
    LOOP AT P_HTML-CONTENT INTO L_HTML_RAW.
      CONCATENATE HTML_XSTR L_HTML_RAW INTO HTML_XSTR IN BYTE MODE.
    ENDLOOP.
    HTML_XSTR = HTML_XSTR(P_HTML-LENGTH).
    SPECIAL CHARACTER CONVERSION
    DATA: HTML_STR TYPE STRING,
          HTML_LEN TYPE I.
    CALL FUNCTION 'SCP_TRANSLATE_CHARS'
      EXPORTING
        INBUFF                   = HTML_XSTR
      INBUFFLG                 = 0
       INCODE                   = '4110'  "utf-8
      OUTBUFFLG                = 0
      OUTCODE                  = '0000'
       CSUBST                   = 'X'
      SUBSTC_HASH              = ' '
      SUBSTC_DOT               = ' '
       SUBSTC_SPACE             = 'x'
      SUBSTC                   = '00035'
    IMPORTING
      INUSED                   =
       OUTBUFF                  = HTML_STR
      OUTOVERFLOW              =
       OUTUSED                  = HTML_LEN
      SUBSTED                  =
      INPUT_ENDS_IN_CHAR       =
      ERRMSG                   =
    EXCEPTIONS
      INVALID_CODEPAGE         = 1
      INTERNAL_ERROR           = 2
      CANNOT_CONVERT           = 3
      FIELDS_BAD_TYPE          = 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.
    CHANGE ENCODING UTF-8 TO LATIN1
    REPLACE ALL OCCURRENCES OF 'UTF-8' IN HTML_STR WITH 'iso-8859-1' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<IMG' IN HTML_STR WITH '<IMG' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '/>' IN HTML_STR WITH '/>' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<A>' IN HTML_STR WITH '' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<' IN HTML_STR WITH '<' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '>' IN HTML_STR WITH '>' IGNORING CASE.
    HTML_LEN = STRLEN( HTML_STR ).
    DATA: L_OFFSET TYPE I,
          L_LENGTH TYPE I,
          L_DIFF TYPE I,
          LT_SOLI TYPE SOLI_TAB,
          LS_SOLI TYPE SOLI.
    L_OFFSET = 0.
    L_LENGTH = 255.
    WHILE L_OFFSET < HTML_LEN.
      L_DIFF = HTML_LEN - L_OFFSET.
      IF L_DIFF > L_LENGTH.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_LENGTH).
      ELSE.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_DIFF).
      ENDIF.
      APPEND LS_SOLI TO LT_SOLI.
      ADD L_LENGTH TO L_OFFSET.
    ENDWHILE.
    DATA: LO_MIME_HELPER TYPE REF TO CL_GBT_MULTIRELATED_SERVICE.
    CREATE OBJECT LO_MIME_HELPER
      EXPORTING
        CODEPAGE = '1133'.
    CALL METHOD LO_MIME_HELPER->SET_MAIN_HTML
      EXPORTING
        CONTENT     = LT_SOLI
       FILENAME    =
       DESCRIPTION =
    HANDLE GRAPHICS
    DATA: L_GRAPHIC TYPE SSF_XSF_GR,
          GR_XSTR TYPE XSTRING,
          L_GR_RAW TYPE BAPICONTEN,
          L_CONTENT_ID TYPE STRING,
          L_CONTENT_TYPE TYPE W3CONTTYPE,
          L_OBJ_LEN TYPE SO_OBJ_LEN,
          L_FILENAME TYPE STRING,
          LT_SOLIX TYPE SOLIX_TAB,
          LS_SOLIX TYPE SOLIX.
    LOOP AT P_GRAPHICS INTO L_GRAPHIC.
      CLEAR: GR_XSTR.
      LOOP AT L_GRAPHIC-CONTENT INTO L_GR_RAW.
        CONCATENATE GR_XSTR L_GR_RAW-LINE INTO GR_XSTR IN BYTE MODE.
      ENDLOOP.
      GR_XSTR = GR_XSTR(L_GRAPHIC-LENGTH).
      L_OFFSET = 0.
      L_LENGTH = 255.
      CLEAR LT_SOLIX[].
      WHILE L_OFFSET < L_GRAPHIC-LENGTH.
        L_DIFF = L_GRAPHIC-LENGTH - L_OFFSET.
        IF L_DIFF > L_LENGTH.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_LENGTH).
        ELSE.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_DIFF).
        ENDIF.
        APPEND LS_SOLIX TO LT_SOLIX.
        ADD L_LENGTH TO L_OFFSET.
      ENDWHILE.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_FILENAME.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_CONTENT_ID.
      L_CONTENT_TYPE = L_GRAPHIC-HTTPTYPE.
      L_OBJ_LEN = L_GRAPHIC-LENGTH.
    ADD IMAGES TO EMAIL
      CALL METHOD LO_MIME_HELPER->ADD_BINARY_PART
        EXPORTING
          CONTENT      = LT_SOLIX
         FILENAME     =
         EXTENSION    =
         DESCRIPTION  =
          CONTENT_TYPE = L_CONTENT_TYPE
          LENGTH       = L_OBJ_LEN
          CONTENT_ID   = L_CONTENT_ID
    ENDLOOP.
    DATA: LO_DOC_BCS TYPE REF TO CL_DOCUMENT_BCS,
          P_SUBJECT TYPE SO_OBJ_DES,
          LV_GBT_MIME TYPE REF TO CX_GBT_MIME,
          LV_BCOM_MIME TYPE REF TO CX_BCOM_MIME,
          LV_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS.
      P_SUBJECT = 'TEST HTML EMAIL FROM SMARTFORM OUTPUT'.
      TRY.
      CALL METHOD CL_DOCUMENT_BCS=>CREATE_FROM_MULTIRELATED
        EXPORTING
          I_SUBJECT          = P_SUBJECT
          I_LANGUAGE         = SY-LANGU
          I_IMPORTANCE       = '5'
          I_SENSITIVITY      = 'F'
          I_MULTIREL_SERVICE = LO_MIME_HELPER
        RECEIVING
          RESULT             = LO_DOC_BCS
       CATCH CX_DOCUMENT_BCS INTO LV_DOCUMENT_BCS.
       CATCH CX_BCOM_MIME INTO LV_BCOM_MIME.
       CATCH CX_GBT_MIME INTO LV_GBT_MIME.
      ENDTRY.
    RECEIVERS
    DATA: P_RECEIVERS TYPE TABLE OF SOMLRECI1,
          RECEIVER TYPE SOMLRECI1,
          L_MAIL_ADDRESS TYPE AD_SMTPADR,
          LO_BCS TYPE REF TO CL_BCS,
          LV_SEND_REQ_BCS TYPE REF TO CX_SEND_REQ_BCS,
          L_USERNAME TYPE UNAME,
          SEND_PARTNER TYPE BU_PARTNER,
          LI_SENDER TYPE REF TO IF_SENDER_BCS,
          LV_ADDRESS_BCS TYPE REF TO CX_ADDRESS_BCS,
          LV_SENT_TO_ALL TYPE BOOLEAN.
    CLEAR RECEIVER.
    RECEIVER-RECEIVER = '[email protected]'.
    RECEIVER-REC_TYPE = 'U'.
    RECEIVER-COM_TYPE = 'INT'.
    APPEND RECEIVER TO P_RECEIVERS.
    L_USERNAME = SY-UNAME.
    CLEAR RECEIVER.
    LOOP AT P_RECEIVERS INTO RECEIVER.
      L_MAIL_ADDRESS = RECEIVER-RECEIVER.
      TRY.
      CALL METHOD CL_BCS=>CREATE_PERSISTENT
        RECEIVING
          RESULT = LO_BCS
       CALL METHOD LO_BCS->SET_DOCUMENT
         EXPORTING
           I_DOCUMENT = LO_DOC_BCS
       CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
      ENDTRY.
    CREATE SENDER
    CLASS CL_CAM_ADDRESS_BCS DEFINITION LOAD.
    TRY.
      IF L_USERNAME NS '@'.
        L_USERNAME = SEND_PARTNER.
        TRANSLATE L_USERNAME TO UPPER CASE.
        LI_SENDER ?= CL_SAPUSER_BCS=>CREATE( L_USERNAME ).
      ELSE.
        DATA: L_FROM_MAIL_ADDRESS TYPE AD_SMTPADR.
        L_FROM_MAIL_ADDRESS = L_USERNAME.
        LI_SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( I_ADDRESS_STRING = L_FROM_MAIL_ADDRESS ).
      ENDIF.
      CALL METHOD LO_BCS->SET_SENDER
        EXPORTING
          I_SENDER = LI_SENDER
    CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    create recepient
    data: LO_RECEPIENT TYPE REF TO IF_RECIPIENT_BCS.
    TRY.
    CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
       EXPORTING
         I_ADDRESS_STRING = L_MAIL_ADDRESS
        I_ADDRESS_NAME   =
        I_INCL_SAPUSER   =
       RECEIVING
         RESULT           = LO_RECEPIENT
      CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    ENDTRY.
    TRY.
    CALL METHOD LO_BCS->ADD_RECIPIENT
       EXPORTING
         I_RECIPIENT  = LO_RECEPIENT
        I_EXPRESS    =
        I_COPY       =
        I_BLIND_COPY =
        I_NO_FORWARD =
      CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    SEND EMAIL DOCUMENT
    TRY.
    CALL METHOD LO_BCS->SEND_REQUEST->SET_REQUESTED_STATUS
      EXPORTING
        I_REQUESTED_STATUS = 'N'
    TRY.
    CALL METHOD LO_BCS->SEND
    EXPORTING
       I_WITH_ERROR_SCREEN = SPACE
      RECEIVING
        RESULT              = LV_SENT_TO_ALL
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    ENDTRY.
    ENDLOOP.
    COMMIT WORK.

  • From:, To: and Subject: end up in email body - html email using sendmail

    To the experts and the experienced:
    I am trying to send email in html format from a Korn shell script on Solaris 10. The
    email does get delivered and is displayed html-formatted, except that the From:, To: and
    Subject: lines are displayed in the email body, rather than in the email header. I
    would appreciate it very much if experts and the experienced could shed some light.
    I use this command line to send the email:
    sendmail -t [email protected] < testmail
    The content of the testmail file is as follows:
    MIME-Version: 1.0
    Content-Type: multipart/alternative; boundary="frontier"
    --frontier
    Content-Type: text/plain
    From: [email protected]
    To: [email protected]
    Subject: test html email
    This is a plain-text email.
    Newman
    --frontier
    Content-Type: text/html
    From: [email protected]&lt;br/&gt;
    To: [email protected]&lt;br/&gt;
    Subject: test html email&lt;br/&gt;
    &lt;h3 align="center"&gt;This is a html email&lt;/h3&gt;
    &lt;p&gt;This is the paragraph.&lt;/p&gt;
    &lt;p&gt;Newman&lt;/p&gt;
    frontier\
    The email received in Microsoft Outlook (html-formatted), looks like this:
    From:         [email protected]
    To:
    Subject:
    From: [email protected]
    To: [email protected]
    Subject: test html email
    <h3 align="center">This is a html email</h3>
    <p>This is the paragraph.</p>
    Newman
    Two things in the email need fixing:
    1. All the From:, To: and Subject: lines are treated as part of the email body and are
    displayed in the email body, rather than in the header as I wanted them to.
    2. The From: line in the email header is the actual sender, not the Bursar.Office as I
    put in the testmail file. This can be easily done when using SMTP (telnet to port 25)
    or mailx.
    How do I tell sendmail/the email client to display in the intended places the From:,
    To: and Subject: information that I specified in the testmail file?
    Many thanks!
    Newman

    I searched in google and found a solution:
    mailx -r [email protected] -s "test html email
    content-type: text/html" john.doe < testmail
    The testmail file is a pure html file with one <html></html> element. The content embedded in this element is the body of the email, with all the usual tags you would like to use: <head>, <style>, &lt;h3&gt;, &lt;p&gt;, &lt;ul&gt;, etc.
    The trick is piggy-backing a content-type with the subject. It seems to me this it to get the content-type into the email header rather than into the body. And that was exactly the problem I had.
    The command lines was executed on Solaris 10. It works.
    Hope this could be useful to someone who would encounter the same problem.
    Newman

  • Fetching Dynamic email address from the HTML content sent in the email body

    Hi All,
    I have a scenario where in i have to send an html content via an email body . while doing so , i need to fetch the email address from the html content and send a mail to the specified email adrress in the html content .
    How to fetch the email address from the html content.
    Regards
    Vinay P.

    Hi ,
    Dynamic configuration means ...do i need to come up with a mapping which contains the  To,From,Subject fields & all...so that when i click on the mail package in mail adapter ...this  "To" email id will be fetched dynamically
    Regards
    Vinay P

  • Burst in HTML format as body of email

    Is this possible?
    I have a very small report that I want to burst to email, but I want the email body to contain the HTML report. (In theory, so it can be read on mobile devices).
    When I set attachment to false, the emails are blank.

    Not certain if you're using EBS but if you do,.. bursting email body can be html formatted like the control file excerpt below...
    <xapi:message id="${TRX_NUMBER}" to="$[email protected]" cc="" bcc=""
              attachment="true" content-type="text/html" subject="TEST ${TRX_NUMBER}">
              <![CDATA[
           <html>
           <body>
           <p>Dear Customer,<br/><br/></p>
           <p>This is a test message.<br/><br/></p>
           <p>This is another test message.<br/><br/></p>
           <p>Thank you again.<br/><br/></p>
           <p>IT Dept<br/></p>
           </body>
              </html>]]>
             </xapi:message>regards,..

  • Sending HTML file as body of email message

    Hello everybody,
    I am trying to send a HTML file as body of an email message using JAVA mail API. If anybody has more insides pls let me know......
    Waiting for your reply!!!!!!!!!

    Here's what our app does:message.setDataHandler(new DataHandler(new ByteArrayDataSource(bodyHTML, "text/html")));where message is a MimeMessage and bodyHTML is a String containing the HTML.

  • Emailing Crystal Report in email body as HTML

    I'm having a problem sending emails in CR 2008 when the report is displayed as HTML in the body of the email. 
    This code works in my development environment but it doesn't work in the testing environment when CR 2008 is installed using a .msi with CR merge modules:
    ExportOptions crExportOptions = new ExportOptions();
    crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
    crExportOptions.ExportFormatType = ExportFormatType.HTML40;
    HTMLFormatOptions htmlOpts = ExportOptions.CreateHTMLFormatOptions();
    htmlOpts.HTMLBaseFolderName = tempPath;
    htmlOpts.HTMLFileName = fileName;
    htmlOpts.HTMLEnableSeparatedPages = false;
    htmlOpts.HTMLHasPageNavigator = false;
    htmlOpts.UsePageRange = false;
    crExportOptions.ExportFormatOptions = htmlOpts;
    _reportDocument.Export(crExportOptions);
    using (StreamReader r = File.OpenText(tempPath + "\\" + Path.GetFileNameWithoutExtension(_template.TemplateName) + "\\" + fileName))
         html = r.ReadToEnd();
    When _reportDocument.Export(crExportOptions) is called this error is thrown:
    Invalid export options.
    I'm I doing something wrong with code, or do I need to do change something in my testing environment to get this to work?
    Testing Environment:
    Windows 2003 Server
    2008 CR SP1 Merge Modules
    .Net 3.5 SP1
    Thanks in advance,
    Dave

    Since it works on your dev system then it is likely not a code issue. I suspect there is a runtime file difference between your dev and staging system. Use [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] to see if you can spot the difference. You'll need to run this on both systems while your app is running.
    On your dev system, go through the procedure of exporting and emailing your report. Then run modules while the app is still running.
    On your staging system, go through the same procedure until you get the error. Leave the error on the screen and run modules.
    Finally, compare the two mdl log files using modules differences feature.

  • Conditional formatting an html email body

    Hi,
    I'm pulling some data out of a database and creating an email with an html body.  I'd like to highlight some of the rows in a colour if for example a particular column is flagged with a zero, I can call the column "expired".  I need it
    highlighted in html because the users who will be receiving the emails need it as easy as possible....
     I don't know a lot of HTML but do know a little SQL and Powershell.  Here is my code
      #Send email Function    
    function sendMail($messagebody) {
         Write-Host "Sending Email"
         #SMTP server name
         $smtpServer = "xxxxx"
         #Creating a Mail object
         $msg = new-object Net.Mail.MailMessage
         #Creating SMTP server object
         $smtp = new-object Net.Mail.SmtpClient($smtpServer)
         #Email structure
         $msg.From = "sdfsdfs@sdfsdfs"
         $msg.ReplyTo = "dfgfdgdf@dfgdfgd"
         $msg.To.Add("dfgdfg@dfgdfgdf")
         $msg.subject = "**:-)**"
         $msg.IsBodyHtml = $true
         $msg.body = $messagebody
         #Sending email
         $smtp.Send($msg)
    $TableHeader = "e Services"          ##The title of the HTML page
    $OutputFile = "C:\MyReport.htm"         ##The file location
    ##set HTML formatting
    $a = @"
    <style>
    BODY{background-color:white;}
    TABLE{border-width: 1px;
      border-style: solid;
      border-color: black;
      border-collapse: collapse;
    TH{border-width: 1px;
      padding: 0px;
      border-style: solid;
      border-color: black;
      background-color:#C0C0C0
    TD{border-width: 1px;
      padding: 0px;
      border-style: solid;
      border-color: black;
      background-color:white
    </style>
    $body = @"
    <p style="font-size:25px;family:calibri;color:#ff9100">
    $TableHeader
    </p>
    $connString = "Data Source=Localhost\SQLEXPRESS,1433;Initial Catalog=Logons;User Id=Matrix; Password=Q@v652500;"
    $QueryText = "exec dbo.LancasterWayBuildingRelated"
    $SqlConnection = new-object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = $connString
    $SqlCommand = $SqlConnection.CreateCommand()
    $SqlCommand.CommandText = "EXEC dbo.LancasterWayBuildingRelated"
    $DataAdapter = new-object System.Data.SqlClient.SqlDataAdapter $SqlCommand
    $dataset = new-object System.Data.Dataset
    $dataAdapter.Fill($dataSet)
    $connection.Close()
    ##Return all of the rows and pipe it into the ConvertTo-HTML cmdlet, and then pipe that into our output file
    $messagebody = $dataSet.Tables | Select-Object -Expand Rows |
    ConvertTo-HTML -head $a –body $body 
    $messagebody | Out-File $OutputFile
    #Write-Host $DataAdapter.Fill($dataset) ' records have been exported.'
    #[string]$all = $dataset.tables[ 0 ] | Out-String
    #Calling email function
    if (!$messagebody) {} else
    {sendMail $messagebody}
    Alter De Ruine

    Hi Sir,
    I would like to check if you need further assistance .
    Best Regards,
    Elton JI
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

  • Blank message body when sending or receiving HTML formated emails Exchange 2010

    I Have just installed Exchange Server 2010 over the weekend on a customers system.  All clients using either Outlook 2003 or 2007 are unable to see any text in the body of emails that are formatted in HTML.  If they receive an email formatted as HTML there is no body text, if they send an Plain Text formatted email the recipient sees the text in the body.  This problem presents across all Exchange users and affects all HTML formatted emails sent or received since transitioning from Exchange 2007 to 2010.  Plain Text and Rich Text email present with no issues. If we import old email via a pst they afre able to see all email text both HTML and plain text. when we access the clients email account via OWA all emails work but then if we go into outlook 2003/2007 and click the email it removes the body text from the email in both the client and OWA have tried Outlook connection issues with Exchange 2010 mailboxes due to RPC encryption requirement
     http://support.microsoft.com/default.aspx/kb/2006508 and it made no difference at all.
    Thanks
    Update: Have just tested further and all pc seem to work ok with either 2003 or outlook 2007 on.  The problem only seems to be happening on the remothe desktop services server which has outlook 2007 ( have also tried outlook 2003 with same results)

    We have just migrated to Exchange 2010 and have had some blank emails come in to our system.  We think we have a reason and fix for
    it. Hopefully this helps someone else…
    Staffs have their own private mailbox (as you would expect) but also share common mailboxes like "Support" and "Info". When an email came
    into the inbox on a shared mailbox, it might be blank. Plain text emails seemed to be okay. 
    We found that when an email came in, it was readable for about two or three seconds (you need to be setup to send a test and check the inbox quickly - we used Outlook 2007 with the reading pane turned on) and then it blanked out!. We checked the incoming
    email by using the arrow keys to select it and then select the email below the new email, if you go back and forth between them you can see the good new email suddenly goes blank.
    So send another test, but this time make sure the email is set to “Plain Text”. Our email turned up fine, two seconds latter
    it had a NOD32 signature appended to the end of it saying that it had been scanned by NOD32 (you may have seen this kind of note appended to the end of emails before).
    What appeared to be happening is that one or more users sitting at their desks in Outlook had different settings configured in NOD32 (they
    were supposed to be using the server based profile that we control). We thought we had the server doing the AV work, but several of our client PCs had NOD32 enabled to integrate with Outlook. New items received in the shared Inbox’s were being scanned
    by the client PCs and having a signature appended which was mucking up the HTML format of the email and Exchange 2010 blanked them out.
    Make sure your AV products aren’t corrupting the email formats causing them to be displayed blank. Try tests using OWA only and don't
    access the mailbox using Outlook.
    Thanks.

  • Auto display HTML attachments in body / email sent from mac mail

    Hi,
    One of my clients has received an email written in MAC Mail, the email doesn't display correctly instead what would be the body of the email appears as an html attachment, he doesn't want to have to click the attachment to preview it as he doesn't have to
    do this on the iphone (also an apple device hmm....), I cant see any way of making it auto display the html in the body without clicking it.
    Does anyone have any ideas?

    Hi,
    Can you confirm if the sender has this problem sending emails to other recipients?
    Please logon your Webmail(or OWA), does that message display as an attachment as well?
    If other Outlook recipients also see the email body as an attachment and you can verify it shows as an attachment on Web as well, I'm afraid we should blame the Apple Mail Client, since I've seen some Apple Mail users have this problem:
    https://discussions.apple.com/thread/1947994?tstart=0
    Kindly have the sender check if the setting like Edit > Attachments > Send Windows friendly Attachments
    has been checked.
    If I'm not getting this wrong, we should confirm this issue with Apple:
    https://discussions.apple.com/index.jspa
    Feel free to post back of course.
    Regards,
    Melon Chen
    TechNet Community Support

  • XML Publisher Email Body Attached Bursting Control File 11i EBS HRMS

    Hi there
    I have a problem with the Brusting , when I received an email through the bursting, I get the Email Body as an Attached File.
    XML Publsiher
    5.6 Build 45
    EBS 11.5.10.2
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    <xapi:request select="/XXPER/LIST_G_COMPANY_CODE">
    <xapi:delivery>
    <xapi:email id= "XXPER" server="is050.atco.com" port="25" from="${FROM_EMAIL_ADDRESS}" reply-to ="${FROM_EMAIL_ADDRESS}">
    <xapi:message id="XXPER" to="${TO_EMAIL_ADDRESS}" attachment="true" subject="XXPER Employees List Company: ${COMPANY_CODE}">
    Status: Normal, Successful Completion.
    Regards
    </xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output="XXPEREmployees List" output-type="pdf" delivery="XXPER">
    <xapi:template type="xsl-fo" location= "xdo://XX.XXPER.en.00/?getSource = true">
    </xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    Regards
    ASIM

    I HAVE ADDED THE FOLLOWING statement BEFORE subject, and it resolved the issue.
    content-type="text/html"
    For Example:
    <xapi:message id="XXPER" to="${TO_EMAIL_ADDRESS}" attachment="true" content-type="text/html" subject="Employees List Company: ${COMPANY_CODE}">
    Regards
    ASIM

  • Background Job result output should be displayed in Email body

    Hi Friends,
    One of our user is scheduling background job, He need the output to his external Email ID.
    user required that Job result output should be displayed in Email body, Not in attachment.
    We have tried but job result received in email as HTML (or) PDF file attachment, But he wants output  in Email body itself.
    Please help.
    Regards,
    Karthickbabu G.G

    Hi,
    Displaying report output in email body is not available as a standard feature. Also doing a custom development would be very cumbersome .
    Regards,
    Deepak Kori

  • Is it possible to burst PDF file on the email body itself?

    Hi,
    Is it possible to show the contents of a PDF file (or any file) on the email body itself and not as an attachment thru bursting control file? We want the message to look exactly as how it looks like in the PDF file, with all the formatting and stuff and not just plain text. So basically instead of the recipient having to open the attached document, we already want the contents of the document shown exactly on the email.
    Thanks,
    Ronaldo

    Actually, I am using onunload() but the result is in-consistent. Sometimes file write to the folder, sometimes don't. I don't know why it behave like this.
    Before onunload(), I tried this cep.util.registerExtensionUnloadCallback, and found out it's not working as expected.
    Now thanks to you and David, I came to know aboutcom.adobe.csxs.events.ExtensionUnloaded but unfortunately this is also not working.
    And then there is an event applicationBeforeQuit which only works when extension (html panel) get closed with host application (Photoshop etc.). If it is closed before the host then we don't get any call. Please let me know if I missed anything here.
    So It looks like we don't have any option here rather than using onunload() which is giving in-consistent result. Can you please take a look into this, may be I am missing something?
    Or may be another work around to store the preferences on closing of extension.
    Thanks for all your help..

  • Text message to email sent as attachment instead of in email body

    I used to have this problem before with my iPhone 4, but it seemed to go away. Now, with the lates OS update it's back again. When I send a text message to my wife's Gmail it arrives as a text file attachment to the email instead of just normal text in the email body.
    I use Verizon, and the source of the email is @vzwpix.com. I know that there is also @vtext.com, but in the past it hasn't mattered which one was used.
    Any ideas?

    If you try reading other posts here about attachments and such you may get a hint. It sounds like all email programs would work fine if people just sent plain text. Problems arise when we use RTF (rich text format) and HTML. Possibly the original email you received had formatted text. My guess is that if you forced that text into plain text then it would be readable by all. This is the reason that only some people have trouble with the forwarded text. It depends on their email client or even on settings of that client.
    Good luck.

Maybe you are looking for