Mail sending with subject and attachment

hai all,
       my requiremnet is i want to send a mail with a body and pdf attachemnt , but with the below code iam able to send both as attachment , but how to send along with body.
*& Report  ZV_TEST                                                     *
Report  ZV_TEST no standard Page heading line-size 200.
Tables: Pa0105,
        pernr,
        QPPNP,
        HRPY_RGDIR,
        SSCRFIELDS,
        pa0002.
Constants
constants:
begin of F__LTYPE, "type of line
CMD like PC408-LTYPE value '/:', "command
TXT like PC408-LTYPE value 's', "textline
end of F__LTYPE.
constants:
begin of F__CMD, "commands
NEWPAGE like PC408-LINDA value '<NEW-PAGE>',
end of F__CMD.
CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
           c_no(1)     TYPE c   VALUE ' ',
           c_device(4) TYPE c   VALUE 'LOCL'.
Data Declaration
DATA:Begin of Itab occurs 0,
       pernr like HRPY_RGDIR-PERNR,
       SEQNR like HRPY_RGDIR-SEQNR,
       PAYSLIP_VARIANT like BAPI7004-PAYSLIP_VARIANT,
     end of itab.
data: P_INFO like PC407,
      P_INFO1 like PC407,
      P_FORM like PC408 occurs 0 with header line,
      P_P_FORM like PC408 occurs 0 with header line,
      RETURN like BAPIRETURN1 occurs 0 with header line,
      PAY_VAR like BAPI7004-PAYSLIP_VARIANT value 'ESS_PAYSLIPS' ,
      P_LIST like ABAPLIST occurs 1 with header line,
      P_IDX type I.
data: begin of P_INDEX occurs 0,
        INDEX type I,
      end of P_INDEX.
data: OBJBIN like SOLISTI1 occurs 10 with header line,
      DOCDATA like SODOCCHGI1,
      OBJTXT like SOLISTI1 occurs 10 with header line,
      OBJPACK like SOPCKLSTI1 occurs 1 with header line,
      RECLIST like SOMLRECI1 occurs 1 with header line,
      OBJHEAD like SOLISTI1 occurs 1 with header line,
      TAB_LINES type I,
      ATT_TYPE like SOODK-OBJTP.
data: PDF_TAB like TBL1024 occurs 0 with header line,
      OTF_TAB like TBL1024 occurs 0 with header line.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
        INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
      wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
      gd_eventparm LIKE tbtcm-eventparm,
      gd_external_program_active LIKE tbtcm-xpgactive,
      gd_jobcount LIKE tbtcm-jobcount,
      gd_jobname LIKE tbtcm-jobname,
      gd_stepcount LIKE tbtcm-stepcount,
      gd_error    TYPE sy-subrc,
      gd_reciever TYPE sy-subrc.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
      gd_destination LIKE rlgrap-filename,
      gd_bytecount LIKE tst01-dsize,
      gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
        INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
DATA:  w_recsize TYPE i.
DATA: gd_subject   LIKE sodocchgi1-obj_descr,
      it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      gd_sender_type     LIKE soextreci1-adr_typ,
      gd_attachment_desc TYPE so_obj_nam,
      gd_attachment_name TYPE so_obj_des.
data: PDF_CONTENT TYPE XSTRING,
      PDF_FSIZE   TYPE I.
data: error        TYPE sysubrc.
DATA: v_dest LIKE tsp01-rqdest,
      v_handle LIKE sy-tabix,
      v_spool_id LIKE tsp01-rqident,
      v_rc TYPE c,
      v_errmessage(100) TYPE c,
      v_text(70) TYPE c.
data: PAYSLIP     LIKE     BAPI7004_PAYSLIP occurs 0 with header line.
Data: v_index like sy-index value 1.
Data: Begin of I_Sent occurs 0,
        pernr like pernr-pernr,
        name(20),
        usrid_long like pa0105-usrid_long,
        Status(3),
      End of I_sent.
Data: Begin of I_NSent occurs 0,
         pernr like pernr-pernr,
        usrid_long like pa0105-usrid_long,
      End of I_Nsent.
DATA: I_FCODE TYPE TABLE OF sy-ucomm.
data: v_text1(255),
      v_text2(255),
      v_text3(255).
data: month_names like T247 occurs 0 with header line,
      v_month(2) type c.
***********************Selection Screen********************
selection-screen Begin of Block b2 WITH FRAME TITLE TEXT-BL1 .
Parameters: P_Print type c default 'X' radiobutton group g1
                                      user-command CMD,
            P_DISP  Type C  Radiobutton Group g1.
Selection-screen end of Block b2.
selection-screen Begin of Block b1 WITH FRAME TITLE TEXT-BL2 .
Recipient address and Period
SELECT-OPTIONS :   s_name   FOR PERNR-PERNR Modif id M1,
                   s_period for HRPY_RGDIR-FPPER Modif id M1.
                  s_year for QPPNP-PABRJ Modif id M1.
SELECT-OPTIONS:    p_num    FOR PERNR-PERNR Modif id M2 .
Selection-screen end of Block b1.
*SELECTION-SCREEN FUNCTION KEY 1.
*SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.
***********************At Selection Screen Output**************
at selection-screen output.
  Loop at screen.
    if P_Print = 'X'.
      if screen-group1 = 'M2'.
        screen-active = 0.
      endif.
    else.
      if screen-group1 = 'M1'.
     if screen-name = 'S_NAME-LOW' Or screen-name = 'S_PERIOD'.
        screen-active = 1.
      endif.
    Endif.
    Modify Screen.
  Endloop.
***********************INITIALIZATION********************
INITIALIZATION.
MOVE 'Preview' TO SSCRFIELDS-FUNCTXT_01.
MOVE 'Preview' TO CHARLY.
  p_print = 'X'.
v_text1 =
'Please find enclosed your salary slip for the month of Apr 2006 as
*attachment. This is confidential '.
***********************AT SELECTION-SCREEN******************
AT SELECTION-SCREEN.
if p_print = 'X'.
   if s_name[] is initial.
      message e000(8i) with 'Make Entry into Personal Number Field'.
   endif.
else.
   if p_num[] is initial.
      message e000(8i) with 'Make Entry into Personal Number Field'.
   endif.
endif.
***********************Start-of-Selection********************
Start-of-Selection.
  if p_print = 'X'.
    APPEND 'NEXT' TO i_fcode.
    APPEND 'PREV' TO i_fcode.
    set pf-status 'ZHRF' excluding I_FCODE.
    Perform Get_values.
   Perform Print using v_index.
    perform Write_Values.
  else.
    set pf-status 'ZHRF'.
  Perform Get_values.
    Perform Print using v_index.
  endif.
***********************Top-of-page***************************
Top-of-page.
  skip 2.
  if p_print = 'X'.
    write:50 'The Pay Slip Sent details'.
    skip 1.
    uline at 1(70).
    write :/ sy-vline,2 'Personal Number',18 sy-vline,
                     19 'Name',40 sy-vline,
                     41 'User Mail-Ids',63 sy-vline,
                     64 'Status',70 sy-vline.
    ULINE /1(70).
  endif.
  set left scroll-boundary Column 0.
*&      Form  Get_values
      text
-->  p1        text
<--  p2        text
FORM Get_values .
  select  *
          from HRPY_RGDIR
          into corresponding fields of table itab
          where PERNR in s_name
          AND
          FPPER IN S_PERIOD.
  if sy-subrc eq 0.
    loop at itab.
      Create receiver list
      refresh RECLIST.
      clear RECLIST.
      select single *
                    from PA0105
                    where PERNR eq ITAB-PERNR
                      and USRTY eq '0010'.
      if SY-SUBRC <> 0.
        I_sent-PERNR = ITAB-PERNR.
        i_sent-status = 'NO'.
        select single *
                      from pa0002
                      where pernr eq itab-pernr.
        concatenate pa0002-VORNA pa0002-NACHN into i_sent-name
                                         separated by space.
        append i_Nsent.
        continue.
      else.
        refresh reclist.
        RECLIST-RECEIVER = pa0105-usrid_long.
        translate RECLIST-RECEIVER to lower case.
        RECLIST-REC_TYPE = 'U'.
        append RECLIST.
      endif.
      call function 'GET_PAYSLIP'
        EXPORTING
          EMPLOYEE_NUMBER = itab-PERNR
          SEQUENCE_NUMBER = itab-SEQNR
          PAYSLIP_VARIANT = PAY_VAR
        IMPORTING
          RETURN          = RETURN
          P_INFO          = P_INFO
        TABLES
          P_FORM          = P_FORM.
      loop at P_FORM
          where LINDA eq F__CMD-NEWPAGE
          and LTYPE eq F__LTYPE-CMD.
        P_INDEX-INDEX = SY-TABIX.
        append P_INDEX.
      endloop.
      P_IDX = 1.
      refresh P_P_FORM.
      append lines of P_FORM from P_IDX to P_INDEX-INDEX
      to P_P_FORM.
      P_IDX = P_INDEX-INDEX.
      export P_P_FORM to memory id '%%_P_FORM_%%'.
      export P_INFO to memory id '%%_P_INFO_%%'.
      submit RPCEDT_LIST_TO_MEMORY exporting list to memory and return.
      call function 'LIST_FROM_MEMORY'
        TABLES
          LISTOBJECT = P_LIST.
      call function 'TABLE_COMPRESS'
        TABLES
          IN     = P_LIST
          OUT    = OBJBIN
        EXCEPTIONS
          others = 1.
      Read table RECLIST index 1.
      I_sent-PERNR = ITAB-PERNR.
      i_sent-usrid_long = RECLIST-RECEIVER.
      select single *
                    from pa0002
                    where pernr eq itab-pernr.
      concatenate pa0002-VORNA pa0002-NACHN into i_sent-name
                                       separated by space.
      i_sent-status = 'YES'.
      append i_sent.
     concatenate ' Payslip-'  '(' ITAB-PERNR+4(4) ')'
    into DOCDATA-OBJ_DESCR.
      CALL FUNCTION 'MONTH_NAMES_GET'
       EXPORTING
         LANGUAGE                    = SY-LANGU
        TABLES
          MONTH_NAMES                 = month_names
       EXCEPTIONS
         MONTH_NAMES_NOT_FOUND       = 1
         OTHERS                      = 2
      IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     if sy-datum+4(2)  = '01'.
        v_month = '12'.
     else.
        v_month = sy-datum+4(2) - 1.
     endif.
     read table month_names with key mnr = v_month.
     concatenate 'Salary Slip for the month of' month_names-LTX
                  sy-datum+0(4) '-' i_sent-name
                  into DOCDATA-OBJ_DESCR.
      DOCDATA-OBJ_NAME = 'Pay Slip'.
      DOCDATA-OBJ_LANGU = SY-LANGU.
      OBJTXT = 'Dear Mr.'.
      concatenate OBJTXT i_sent-name into objtxt.
      append OBJTXT.
      append initial line to objtxt.
      OBJTXT = 'Please find enclosed your salary slip for the month of'.
      concatenate OBJTXT month_names-LTX sy-datum+0(4)
                                  into objtxt separated by space.
       append OBJTXT.
OBJTXT =
'as attachment This is confidential document and not be disclosed'.
      append OBJTXT.
OBJTXT =
'shared with any other employee.In case of any queries on this subject'.
append OBJTXT.
OBJTXT =
'you are requested to contact the Payroll administrator “Sabitha” '.
OBJTXT = 'email:[email protected]'.
append OBJTXT.
append initial line to objtxt.
append initial line to objtxt.
OBJTXT = 'With Kind Regards'.
append OBJTXT.
append initial line to objtxt.
append initial line to objtxt.
OBJTXT = 'Sabitha'.
append OBJTXT.
OBJTXT = 'Payroll Administrator'.
append OBJTXT.
OBJTXT = 'Enteg Infotech Pvt Lyd.'.
append OBJTXT.
OBJTXT = 'Banaglore'.
append OBJTXT.
      Write Packing List (Main)
       describe table objtxt.
       read table OBJTXT index sy-tfill.
      DOCDATA-DOC_SIZE = ( sy-tfill - 1 ) * 255 + strlen( OBJTXT ).
      clear OBJPACK-TRANSF_BIN.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = sy-tfill.
      OBJPACK-DOC_TYPE = 'TXT'.
      append OBJPACK.
Create Message Attachment
Write Packing List (Attachment)
      ATT_TYPE = 'ALI'.
      describe table OBJBIN lines TAB_LINES.
      read table OBJBIN index TAB_LINES.
      OBJPACK-DOC_SIZE =
      ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
      OBJPACK-TRANSF_BIN = 'X'.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = ATT_TYPE.
      OBJPACK-OBJ_NAME = 'ATTACHMENT'.
      OBJPACK-OBJ_DESCR = 'Payslip'.
      append OBJPACK.
Send the document
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = DOCDATA
          PUT_IN_OUTBOX              = ''
          COMMIT_WORK                = 'X'
        TABLES
          PACKING_LIST               = OBJPACK
          OBJECT_HEADER              = OBJHEAD
          CONTENTS_BIN               = OBJBIN
          CONTENTS_TXT               = OBJTXT
          RECEIVERS                  = 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.
    endloop.
  endif.
ENDFORM.                    " Get_values
*****************************At User Command*************************
at User-Command.
  case Sy-ucomm.
    When 'NEXT'.
      describe table itab.
      if sy-tfill GT v_index.
        v_index = v_index + 1.
        Perform Print using v_index.
      else.
        message E000(8i) with 'You Have Reached the Last Entry'.
      endif.
    When 'PREV'.
      if v_index LE 1.
        Message E000(8i) with 'You Have Reached the First Entry'.
      else.
        v_index = v_index - 1.
        Perform Print using v_index.
      endif.
    When 'BACK'.
      leave to screen 0.
    WHen 'EXIT'.
      set Screen 0.
      leave screen.
  Endcase.
*&      Form  Print
      text
-->  p1        text
<--  p2        text
FORM Print using v_index.
  if v_index = 1.
    select  *
           from HRPY_RGDIR
           into corresponding fields of table itab
           where PERNR in P_num
  endif.
  if not itab[] is initial.
    sort itab by pernr .
    read table itab index v_index.
    select single *
                  from PA0105
                  where PERNR eq ITAB-PERNR
                    and USRTY eq '0010'.
    call function 'GET_PAYSLIP'
      EXPORTING
        EMPLOYEE_NUMBER = itab-PERNR
        SEQUENCE_NUMBER = itab-SEQNR
        PAYSLIP_VARIANT = PAY_VAR
      IMPORTING
        RETURN          = RETURN
        P_INFO          = P_INFO
      TABLES
        P_FORM          = P_FORM.
    loop at P_FORM
        where LINDA eq F__CMD-NEWPAGE
        and LTYPE eq F__LTYPE-CMD.
      P_INDEX-INDEX = SY-TABIX.
      append P_INDEX.
    endloop.
    P_IDX = 1.
    refresh P_P_FORM.
    append lines of P_FORM from P_IDX to P_INDEX-INDEX
    to P_P_FORM.
    P_IDX = P_INDEX-INDEX.
       export P_P_FORM to memory id '%%_P_FORM_%%'.
       export P_INFO to memory id '%%_P_INFO_%%'.
  IMPORT P_P_FORM FROM MEMORY ID '%%_P_FORM_%%'.
  IMPORT P_INFO FROM MEMORY ID '%%_P_INFO_%%'.
    new-page                                                "VKIK008647
    line-size p_info-pcols
    line-count p_info-psize
    no-title
    no-heading.
    SET BLANK LINES ON.
    LOOP AT P_P_FORM.
      if sy-tabix lt 20.
        NEW-LINE NO-SCROLLING.
      endif.
      CASE P_P_FORM-LTYPE.
     WHEN F__LTYPE-TXT.
        WRITE:/ P_P_FORM-LINDA.
        WHEN F__LTYPE-CMD.
          IF P_P_FORM-LINDA EQ F__CMD-NEWPAGE.
            NEW-PAGE.
          ENDIF.
        WHEN others.
          hide: itab,v_index.
          WRITE:/ P_P_FORM-LINDA.
          if sy-tabix lt 20.
            NEW-LINE NO-SCROLLING.
          else.
            NEW-LINE SCROLLING.
          endif.
      ENDCASE.
    ENDLOOP.
    SET BLANK LINES OFF.
v_index = 1.
  endif.
ENDFORM.                    " Print
*&      Form  Write_Values
      text
-->  p1        text
<--  p2        text
FORM Write_Values .
  if p_print = 'X'.
    loop at i_sent.
      write :/ sy-vline,2 i_sent-pernr,18 sy-vline,
                        19 i_sent-name,40 sy-vline,
                        41 i_sent-usrid_long,63 sy-vline,
                        64 i_sent-status,70 sy-vline.
      ULINE /1(70).
    endloop.
  endif.
ENDFORM.                    " Write_Values
i want to send the contents of objtxt has body.
cheers

Hi,
in the below code, BOLD Characters coming as body text in my mail.after that i am attaching V_LINE as the attachment.pl compare this with ur code.
revert, if you need any clarifications.
<b>*-populate body text</b>
  CONCATENATE <b>'Japan BOL details for the Delivery#'
                V_VBELN
               ',is attached'</b>               INTO WA_OBJTXT SEPARATED BY SPACE.
  APPEND WA_OBJTXT TO IT_OBJTXT.
<b>*---- Append Date and Time into Body of email.</b>
  MOVE 'File is generated on'(004) TO V_INFO.
  V_TIME = SY-UZEIT.
WRITE : SY-UZEIT TO V_TIME USING EDIT MASK '__:__:__'.
  CONCATENATE V_TIME+0(2)
              V_TIME+2(2)
              V_TIME+4(2)
              INTO
              V_TIME2 SEPARATED BY ':'.
   WRITE : sy-datum MM/DD/YYYY TO lv_date .
  CONCATENATE SY-DATUM+4(2)
              SY-DATUM+6(2)
              SY-DATUM+0(4)
              INTO V_DATE.
  CONCATENATE <b>V_INFO
              V_DATE
              'At'
              V_TIME2
              INTO V_INFO</b>              SEPARATED BY SPACE.
  <b>WA_OBJTXT = V_INFO.</b>  APPEND WA_OBJTXT TO IT_OBJTXT.
*-document size
  CLEAR : V_TABLE_LINES.
  DESCRIBE TABLE IT_OBJTXT LINES V_TABLE_LINES.
  READ TABLE IT_OBJTXT INTO WA_OBJTXT INDEX V_TABLE_LINES.
  X_DOC_CHNG-DOC_SIZE =
                 ( V_TABLE_LINES - 1 ) * 255 + STRLEN( WA_OBJTXT ).
*-populate packing list for body text
CLEAR IT_OBJPACK-TRANSF_BIN.
  WA_OBJPACK-HEAD_START = 1.
  WA_OBJPACK-HEAD_NUM = 0.
  WA_OBJPACK-BODY_START = 1.
  WA_OBJPACK-BODY_NUM = V_TABLE_LINES.
  WA_OBJPACK-DOC_TYPE = 'RAW'.
  APPEND WA_OBJPACK TO IT_OBJPACK.
  CLEAR WA_OBJPACK.
*--for attachment
*--add Internal table lines here, as attachment.
  WA_OBJBIN = V_LINE.
  APPEND WA_OBJBIN TO IT_OBJBIN.
  CLEAR  WA_OBJBIN.
*-get total no.of lines of Object table(attachment)
  CLEAR : V_TABLE_LINES.
  DESCRIBE TABLE IT_OBJBIN LINES V_TABLE_LINES.
*-populate object header
  CONCATENATE  'Delivery#'(005)
                 V_VBELN
                 SY-DATUM
                 V_TIME
                 INTO
                 WA_OBJHEAD SEPARATED BY SPACE.
  APPEND WA_OBJHEAD TO IT_OBJHEAD.
  CLEAR  WA_OBJHEAD.
*-packing list for attachment
  WA_OBJPACK-TRANSF_BIN = C_X.
  WA_OBJPACK-HEAD_START = 1.
  WA_OBJPACK-HEAD_NUM = 1.
  WA_OBJPACK-BODY_START = 1.
  WA_OBJPACK-BODY_NUM = V_TABLE_LINES .
WA_OBJPACK-DOC_TYPE = 'CSV' .
  WA_OBJPACK-DOC_TYPE = 'RAW' .
  WA_OBJPACK-OBJ_NAME = 'POTR'.
CONCATENATE 'Delivery details for '(005)
  CONCATENATE TEXT-005
            V_VBELN
            SY-DATUM
            V_TIME
            '.CSV'
            INTO
            WA_OBJPACK-OBJ_DESCR SEPARATED BY SPACE.
  BREAK-POINT.
  WA_OBJPACK-DOC_SIZE = V_TABLE_LINES * 255.
  APPEND WA_OBJPACK TO IT_OBJPACK.
  CLEAR  WA_OBJPACK.

Similar Messages

  • Setting windows mail as default "Mail To" doesn't work as usual. Opens entire windows mail vs. email new email message with subject and URL inserted

    I have a problem never had B 4. Have installed new Win7 OS many times and imported windows mail. Always when choosing windows mail in FF it worked. Now when doing I get windows mail program opening or if open coming to forefront or screen. Supposed to get a new email message with subject and URL inserted. I have searched many answers fro FF & MS. I have set WinMail as default, add ed same in reg, etc. etc. Still NADA. Any ideas? thanks

    You should post here:
    Microsoft Office forums >
    Word IT Pro Discussions
    S.Sengupta, Windows Entertainment and Connected Home MVP

  • How do you change the position of email sender so that it's on the left (sender[from], subject and date received)

    How do you change the position of email sender so that it's on the left (sender[from], subject and date received)

    In the Thread Pane where your messages are listed?
    You see that bar with the labels "From", "Subject", "Date" and so on? Well, they are buttons. You can click on them to sort your messages. You can also drag them with the mouse left and right to reposition them, and you can drag their ends to change the column widths.
    These are standard computer actions; you can do all of this in Windows Explorer ("My Computer") too.
    In Thunderbird, a right-click on any of these buttons will reveal a pop-up menu where you can select and deselect the columns to control what is shown.
    More here: http://www.ramsden.org.uk/8_How_to_sort.html

  • I tried to send an email and attach a photo and color wheel has been spinning forever

    I tried to send an email and attach a photo and color wheel has been spinning forever. Clearly it is still trying to send the message and it's been 45 minutes. I can't use my mail anymore.

    First off, did you check your internet conection? Your network connection might not be very strong. Try powering your device and turning it on again, see if that works.

  • [Q] what is different of mail sending between HPUX and Solaris ??

    All,
    Would somebody let me know what different of mail sending between HPUX and Solaris is ?
    I have several unix servers and some are HPUX 11.11 and some are Solaris v8.
    To use "mailx" command in maintenance scripts, I set a relay server in sendmail.cf of /etc/mail.
    What I'm curious is
    ,in HPUX, "mailx" is working without sendmail daemon. but in Solaris, "mailx" is not working without sendmail daemon.
    I'm not good at those sendmail site. my knowldge of UNIX is very general, not specific and expertized. so need your help.
    Why it works without sendmail daemon on HPUX, and why not on SUN which is not working sendmail daemon ??

    Hi,
    do you have a mailhost entry in /etc/hosts pointing to your relay hsot?
    Fritz

  • SEND EMAIL WITH PO AND ATTACHMENT FILES

    Hi,
    I'm working with MySAP Enterprise 4.7 and I want to send the PO and its attachment vía e-mail, currently only the PO is being sent to the Vendor and the attachment only appears like texts into the "body" of PO. Is there some way to send e-mail with the PO and attachments at the same time??
    I attached the document via DMS at position level.
    Thanks in advanced for your answer and help!!
    Regards,
    Blanca Reyes

    hi
    Follow these steps
    Basically there are two mail types: Internet mail (external mail) and
    SAPOffice mail.
    Mail is sent via the output determination in both cases.
    If you use the external mail, the message for the purchasing document is
    converted into a corresponding text file which is sent to the vendor via
    the Internet.
    SAPOffice mail is sent only within the R/3 System and has mainly the
    function of providing information.
    In particular, it is not possible to attach a message (form) for a
    purchasing document to a SAPOffice mail.
    When using external mail, the following basic settings are required:
    1. You must maintain an e-mail address in the address in the vendor
    master.
    2. The same applies to your own user master. You also have to specify
    an e-mail address there in order to identify the sender.
    o Note that it is not possible to change the e-mail address of the endor
    o You can use a temporary email address in Transaction ME21N.
    3. For the output type for default values, a communication strategy
    needs to be maintained in the Customizing that supports the e-mail.
    You can find the definition of the communication strategy in the
    Customizing via the following path: (SPRO -> IMG -> SAP Web
    Application Server -> Basic Services -> Message Control -> Define
    Communication Strategy). As a default, communication strategy CS01
    is delivered. This already contains the necessary entry for the
    external communication. Bear in mind that without a suitable
    communication strategy it is not possible to communicate with a
    partner via Medium 5 (external sending).
    4. Use the standard SAP environment (program 'SAPFM06P', FORM routine
    'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
    5. In the condition records for the output type (for example,
    Transaction MN04), use medium '5' (External send).
    6. You can use Transaction SCOT to trigger the output manually. The
    prerequisite for a correct sending is that the node is set
    correctly. This is not described here, but it must have already been
    carried out.
    7. To be able to display, for example, the e-mail in Outlook, enter PDF
    as the format in the node.
    To use the SAPOffice mail, the following basic settings are required:
    1. For the output type for default values, a communication strategy
    needs to be maintained in the Customizing that supports the e-mail.
    You can branch to the maintenance of the communication strategy via
    the input help.
    2. Use the SAP standard environment (program "RSNASTSO" and FORM
    routine "SAPOFFICE_AUFRUF") as the processing routines.
    3. In the condition records for the output type (for example,
    Transaction MN04), use medium '7' (SAPOffice) and also partner role
    'MP' (mail partner).
    Additional settings:
    Problem:
    How can you both change the mail title and text for the sending of a
    mail message and maintain a replacement parameter, for example a
    document number.
    Solution:
    1. The replacement routine is maintained in the Customizing for the
    output type in the detail screen on the 'General data' tab under
    'Replacement of text symbols' (for Release < 4.6B, this can be found
    on the 'Mail' tab page).
    Program: SAPMM06E
    FORM routine: TEXT_SYMBOL_REPLACE
    2. Maintain mail title and text.
    o If you want to send a purchase order within an R/3 system using
    the SAP office, you can maintain both the mail title ('Re:') and
    also a mail text in the Customizing for the output type To do
    this, select the directory mail title and text for the
    corresponding message type.
    o If you want to send a purchase order as (external) mail, for
    example, to a vendor, you have to maintain the mail title in the
    condition record for the output type (for example in Transaction
    MN05) on the 'Communication method' tab page. Enter the mail
    title in the 'Text for cover page' field. You cannot maintain an
    additional mail text.
    o Note that the values from the mail title are used to create the
    description for the attachment.
    3. The replacement parameters must be enclosed by &. Example: You want
    to enter the title 'PO number '. For this you have to enter
    the following in the Document Title field (Message Customizing ->
    sub-option: Mail title and texts) 'PO number &EKKO-EBELN&'
    Reward points if helpful
    regards
    chetan

  • Mail Sending- with Unicode enabled text in the attachment

    hi,
    i have a specific requirement for JAPAN country. its as follows:
    i am retrieving delivery details into my program & i need to send them as in a mail attachment(as CSV file) to particular mail id.
    for sending mail, i am using the function module "SO_NEW_DOCUMENT_ATT_SEND_API1".
    here is my problem :
    as this program will be used by JAPAN people, some of the delivery details are stored in Japanese (text like Customer name,street address etc..)
    .so when i am trying to send it as attachment these japanese text is not appearing correctly in the mail attachment. its appearing as Junk characters.
    i observed here the problem is may be because these Texts are not sending with UNICODE format. may be the default format is ASCII, which can not
    interpret Japanese text properly.
    so pl let me know is there any new function module where we can mention the Encoding format like UNICODE ?? or can i use the
    same above mentioned function module with providing this UNICODE value somewhere....
    regards
    srikanth,Intelligroup.
    Message was edited by: Srikanth Kidambi

    Hi,
    Check the answer from xiaoming cai in this thread:
    Send mails with attachment to external email id
    Eddy

  • To send a mail along with a csv attachment.

    Hi All,
    my requirement is to send a mail along with a csv file attached to it. Could someone provide me their valuable comments that will guide me. I am using the function module.
    SO_NEW_DOCUMENT_ATT_SEND_API1.

    https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=6015600
    https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=3640641
    https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=6879100
    https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=5281059

  • Versamail no show incoming mails sender's name and subject after ROM upgrade

    It is unlocked GSM 680 before with rom ROW 1.04 and worked quite well. After the upgrade to R01.92 1.12ROW, the incoming emails doesn't show sender's name(address) and subjects, but email content displays correctly. Don't know if the VERSAMAIL program has lost some files or modules. Anyone can help?
    Post relates to: Treo 680 (Unlocked GSM)

    I see the subject of this post specifically mentions a ROM upgrade. I didn't do a ROM upgrade but I had the same exact symptom after installing CJKOS which allows Chinese, Japanese, Korean characters be displayed on my Palm Treo. The CJKOS preferences are not in English but eventually I was able to figure out if I disable that application within that app's preferences, the sender's name and subjects are now appearing. Maybe there is something the few of you are doing that is similar?
    Post relates to: VisorPhone

  • E-mail sending with progress bar

    OK so I have a application that allows the user to send an e-mail with multiple attachments. It works fine but I want to add a progress bar - when the user clicks SEND, a new window should pop-up with a progress bar and a OK button after the mail has been successfuly sent.
    Any ideas how to accomplish this?
    Mail sending is handled by this class and is called from a frame:
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.FileDataSource;
    import javax.activation.DataHandler;
    import java.util.Properties;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Vector;
    import java.io.File;
    import java.io.*;
    public class Mailer implements Runnable {
    boolean success = false;
    String sendToAddress, ccAddress, sendFromAddress,
    subject, messageText, filename, smtpServer;
    mainFrame2 frame;
    public Mailer(String sendToAddress, String ccAddress, String sendFromAddress, String subject, String messageText, String filename,
    String smtpServer, mainFrame2 frame)
    this.sendToAddress = sendToAddress;
    this.ccAddress = ccAddress ;
    this.sendFromAddress = sendFromAddress;
    this.subject = subject;
    this.messageText = messageText ;
    this.filename = filename;
    this.smtpServer = smtpServer ;
    this.frame = frame;
    public void run() {  
    sendMail();
    public void sendMail() {
    Properties props = System.getProperties();
    props.put("mail.smtp.host", smtpServer);
    Session session = Session.getInstance(props, null);
    MimeMessage msg = new MimeMessage(session);
    Multipart mp = new MimeMultipart();
    BodyPart body = new MimeBodyPart();
    BodyPart attachment = new MimeBodyPart();
    try {
    msg.setFrom(new InternetAddress(sendFromAddress));
    msg.setRecipient(javax.mail.Message.RecipientType.TO,
    new InternetAddress(sendToAddress));
    if(ccAddress.length()>3)
    msg.setRecipient(javax.mail.Message.RecipientType.CC, new InternetAddress(ccAddress));
    msg.setSubject(subject);
    msg.setSentDate(new Date());
    msg.addHeaderLine("MIME-Version: 1.0");
    msg.addHeaderLine("Content-type: text/html; charset=\"windows-1251\"");
    body.setText(messageText);
    FileDataSource fds = new FileDataSource(new File(filename));
    DataHandler dh = new DataHandler(fds);
    attachment.setDataHandler(dh);
    attachment.setFileName(filename.substring(filename.lastIndexOf("\\", filename.length())+1));
    mp.addBodyPart(body);
    mp.addBodyPart(attachment);
    // this here is for the attachments, I've already collected them into a Vector
    for(int i=0; i < frame.attachedFiles.files.size(); i++)
    int chertichka = frame.attachedFiles.files.get(i).toString().lastIndexOf("\\");
    String ime = frame.attachedFiles.files.get(i).toString().substring(chertichka+1);
    BodyPart attachment1 = new MimeBodyPart();
    FileDataSource fds1 = new FileDataSource(new File(frame.attachedFiles.files.get(i).toString()));
    DataHandler dh1 = new DataHandler(fds1);
    attachment1.setDataHandler(dh1);
    attachment1.setFileName(ime);
    mp.addBodyPart(attachment1);
    turgData.doc_to_attach = "";
    msg.setContent(mp);
    Transport.send(msg);
    } catch (MessagingException e) {
    e.printStackTrace();
    success = true;
    public static boolean isEmailAddress(String text)
    if(text.indexOf(" ")>-1) return false;
    int kliomba = text.indexOf("@");
    int dotCom = text.lastIndexOf(".");
    if(kliomba < 2 || kliomba >(text.length()-4)) return false;
    else if(dotCom > (text.length()-2)) return false;
    else return true;
    public boolean isSent()
    return success;
    Please provide some code on how to put a progress bar in a pop-up window after the user clicks SEND. Also, the send button should be disabled until the mail has been sent.
    PLZ help me out ;)))

    Hi,
    Check the links for Email Adapter,If u want to send the Attachment then give me ur mail id i will send you one doc which will explain u how to send Email in Attachment.
    Receiver Mail Adapter.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    eMail Reporting
    /people/community.user/blog/2006/09/07/email-reporting
    Regards,
    Phani
    Reward points if Helpful

  • Receiver mailadapter with mailpackage and attachment

    Hi there!!
    My scenario is as folows:
    I send via ABAP proxy an application XML and add additional plain text attachment to this. At the receiver side I use receiver mailadapter with mail-package. With my interface mapping I map application XML to mailpackage and use content-type text/HTML. I checked checkbox in adapter "keep attachments".
    Result is that the mail i receive contains 2 attachments (1 HTML file and 1 .txt file). However the main body of the e-mail contains the content of the plain text file. I want to have the content of the html to be the main body of the mail. I already tried to use payload swap been however without succes because it seems that in the adapter module chain when reaching the actual mail module: sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean the main payload is switched to the plain text attachment. Also changing the sequence in the module chain did not work.
    Any suggestions?
    Cheers,
    Emile

    When you want to use mail package to create an email with attachment, the whole email, body and attachment must be inside the tag content_type.
    Like in this blog:
    /people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
    In your scenario, you should uncheck the flag "mail package".
    Regards
    Stefan

  • SOAP Axis sender with CSV file attachment

    Hi Experts,
    I have a requirement where I receive a CSV file attachment from a Web Service post ( i.e a SOAP sender with attachment). I decided to use SOAP with Servlet(Axis) protocol, since standard SOAP sender does not allow modules to be used.
    I am able to test this interface through SOAPUI with attachment to the point where I can get the attachment payload as my main payload in IE, but it fails in mapping since CSV needs to be converted to XML. I have following queries for proceeding ahead with this scenario:
    1. How do I convert the CSV attachment to XML inorder for mapping to be used in IE. Is there a standard axis handler available for this ???? Also where should this handler be called in the sequence of Axis modules ???
    2. Can I use MessageTransformationBean for converting plain to XML ??? If yes where should this module be called in the sequence of Axis modules. I tried using this module between the CallSapAdapter and the first AdapterBean but it returns exception in SOAPUI saying " Messaging exception: No Main"
    3. Is there a blog available which illustrates about using additional modules/handlers in Axis. I have had a look at the FAQ note of Axis but it just gives the overview.
    Thanks.
    Siddhesh S.Tawate

    Solved :).
    1     AF_Adapters/axis/HandlerBean                     Local Enterprise Bean                              xireq
    2     AF_Adapters/axis/AFAdapterBean                     Local Enterprise Bean                              afreq
    3     localejbs/AF_Modules/MessageTransformBean    Local Enterprise Bean                     Plain2XML
    4     CallSapAdapter                                          Local Enterprise Bean                              sap
    5     AF_Adapters/axis/AFAdapterBean                    Local Enterprise Bean                             afresp
    6     AF_Adapters/axis/HandlerBean                    Local Enterprise Bean                             xires
    Above sequence worked. I guess I was missing some parameter in content conversion earlier.
    Thanks.

  • E-mail merge with Word and Outlook problem

    I'm trying to do an e-mail merge with Office 2011: Word, Excel, and Outlook.
    Before you start typing, I've already searched the web, searched the Apple forums, and posted to the Microsoft forum, with no success.
    Anyway: I have outlook configured to send and receive mail from a single Gmail account.
    Outlook works otherwise to send and receive mail.
    Outlook is set, in both Mail and Outlook, to be the default e-mail program.
    Everything seems to work fine until the final step, clicking the generate e-mail merge button that should send the mail merge to Outlook. The mail merge emails are supposed to appear in Outlook, but they don't.
    If you have figured out how to do this, please let me know.
    I would prefer to do this with Mail and Numbers, or Excel and Mail, but that functionality does not exist. I'm sure it would probably work if it did.
    I have a standalone mail merge app (MaxBulk Mailer) but I'd prefer to use the database I already have, which is in Excel, rather than have to create two databases, one in Excel, and another in MaxBulk. MaxBulk has some other problems as well and is not a great solution. 
    Thanks.

    Not sure if this is entirely the same issue but.... we just saw a very similar issue resolved here by my recommending that one of our mail merge-using faculty run the Outlook 2011 database rebuild utility (holding down option while starting Outlook 2011 for OSX).  Mail Merging from Excel 2011 mailing lists to Outlook 2011 starting working like a charm after that.
    The differences with our setup were that we were sending a mail merge via an Exchange Server, not GMail, and that this issue started after upgrading from 10.6 to 10.9 via the App Store.  Mail Merging had been working fine in 10.6.
    Worth a try?  Guard your backups and good luck!

  • How to send mail with cc and attachment

    please provide code for sending a file with attchment in cc also

    HI Rajesh,
    There is a standard structure for Receiver Mail adopter which we can get from SAP market Place but it is not provided with CC if u want to use CC then you have to go with Dynamic Configuration.
    DynamicConfiguration configuration = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
    /*any other required fields*/
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Mail", "THeaderCC");
    configuration.put(key, "ccemail @ test.com");
    Regards
    Praveen Reddy
    Edited by: Maareddy Praveen Reddy on Aug 10, 2011 12:17 PM

  • How to send Oracle report automatically in format pdf by email with subject and body?

    Hello,
    How to send e-mail attachment and mail other details like from ,subject,cc,to,mail body. In Oracle Developer Suite 10g?
    Regards.

    did you try to run report parameter form = yes ,
    put to the parameter form following system parameters  and set et.
    run report  with belove value
        - DESTYPE = MAIL
        - DESFORMAT = PDF
        - DESNAME =  mail adres
    then according to the result ,rearrange your report forms side  while invoke report from forms
         -  SET_REPORT_OBJECT_PROPERTY(  reportobject_id , DESTYPE          , mail ) ;
         -  SET_REPORT_OBJECT_PROPERTY(  reportobject_id , DESFORMAT     , PDF ) ;
         -  SET_REPORT_OBJECT_PROPERTY(  reportobject_id , DESNAME          , mail adres ) ;

Maybe you are looking for

  • Re: Memory upgrade on Satellite U200

    Where is the memory located on this model as can not see it with any removableable panel? Ta

  • Excise duty is not displaying in MIGO

    Dear All., I have captured excise invoice against Purchase Order in J1IEX .Then i have done GR for that PO. While doing GR, I have referred  the excise invoice which was previously captured against PO. After posting the GR,when i display it in MIGO,e

  • Opening a PDF in IE

    When I click on a hyperlink for a PDF in internet explorer, it get the usual, OPEN, SAVE or CANCEL, when I click OPEN, it launches another IE window before it open the PDF in Adobe Acrobat (Pro 8.1.2). On my old computer, this never happened, and I'd

  • There was a problem connecting to the server "SERVER1".

    When I start iMovie I receive an error message "There was a problem connecting to the server "SERVER1"." The problem is that server1 has been retired and is no longer available. This error message is persistent and prevents the proper useage of imove

  • 'Lolipop 5.0.2, Quick charging 2.0'

    Hello, guys So I have updated my Xperia Z2 to latest (5.0.2), and alot of people are saying the phone is compatible with Quick Charge 2.0.  So I am curious if anyone of you have tried, or know more? As long as the charger is quick charger from qualco