Mail with attachment.

Hi all,
I need to sena a mail with a text file as attachement from SAP to a standard mail recipient.
Can somebody give me a sample code?
Points will be rewarded.
Thanx in advance.
Regards,
Amit

Hi Amit,
1. We can send files with attachment.
However, There is some trick involved
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
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 = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
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
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m.

Similar Messages

  • Question: Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages? - Problem: I have 1400 e-mails with attachments that need to be conv

    Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages?
    - Problem: I have 1400 e-mails with attachments that need to be converted into pdf and the attachments cannot be embeded.
    System: PC Windows 7 using Acrobat X Prof. - Thank you!

    Hi ,
    There is an option of embedding index for faster search while converting email to a PDF .
    However I am not sure that will serve your purpose or not .
    I would recommend you to get in touch with Microsoft support as well .
    Meanwhile I'll work on it and get back to you in case I get a desired solution .
    Regards
    Sukrit Dhingra

  • Sending mail with attachment and body.

    Hi Experts,
    I have a requirement of sending a mail with an attachment and also the mail will have a body whose content will be same as that in the attachment.Subject of the mail will also be configured dynamically.Though I am able to send the mail with the attachment but I am not able to configure the body whose content will be same as that of the attachment.
    I have unchecked the "Use Mail Package" and has hard-coded the "TO","From" field for sending the mail with attachment.
    Can you please check and let me know how to configure the body which will be same as that of the attachment.
    Thanks and Regards
    Atanu Mazumdar

    Hi,
    Use MTB module and then one of the parameter which can allow you to send message in attachment as well as in message body.
    Transform.ContentDisposition: it helps us to decide if we want to send the payload as an attachment or in the message body. If we give the Parameter value as u201Cattachmentu201D then we will have the payload attached in the mail and if we assign this value as u201Cinlineu201D the payload will go in the mail body.
    Hope this helps you..
    Regards....

  • Sending mail with attachment fails on MAC Mail and WRP400.

    Sending mail with attachment fails on MAC Mail and WRP400.
    We have hundreds of WRP400 connected with Mac (Machintosh) computers. No special configurations are applied (no virtual server or DMZ). Web navigation, P2P programs and sending mail without attachment work right.
    The problem is the impossibility to send mails with medium or big size files attachment from MAC Mail.
    If we use Windows PCs or a different linksys routers (eg. WRT54G) the problem not happens.
    We have upgraded WRP400 firmware version from 1.00.06 to 2.00.05 but the result is the same. Sending mail with attachment using Mac fails.
    We tried to configure WRP400 with DMZ to a particular MAC. We tried to configure Virtual server on tcp 25 port of a MAC. The result is always the same.
    This is a WRP400 bug? Windows PCs work right. MAC and MAC mail works right with other linksys router.
    We need help. Thanks.

    The problem was fixed since beta firmware 2.00.11.
    I think that this issue was caused from a bug that decrease upload bitrate of WRP400 after some days of activity.
    See more details on Cisco forum under title "WRP400 stops responding after browsing certain websites".
    Thanks.

  • Mail_Receiver: Send Mail with attachment

    Hi everybody,
    I need some help. I want to send a mail with attachment.
    for this I have imported SAPs xsd for the mail adapter.
    I wonder how to map the target fields?
    The following causes five! attachments in SXMB_MONI and the adapter throws
    java.lang.IllegalArgumentException: can't parse argument number
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
          <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
             <Subject>SubjctName</Subject>
             <From>mailadress</From>
             <To>mailadress</To>
             <Content_Type>text/plain; charset=&quot;ISO-8859-1&quot;</Content_Type>
             <Content_Description>
                <attachment filename="filename.txt">This should be the content of the attachment</attachment>
             </Content_Description>
             <Content>Constant</Content>
          </ns1:Mail>
       </ns0:Message1>
    </ns0:Messages>
    How do I have to foll the target fields?
    Thanks regards
    Mario

    Hi
    the following links may help you :
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    Also reffer to the below mentioned thread;
    Regarding mail sent with an excel attachment
    Regard's
    Chetan Ahuja

  • Convert Script output data to Text(.txt) file & send mail with attachment.

    Hi All,
    Requirement: I shulb be able to conver th Script output data to Text(.text) file & send a maill with attachment with this text file. Formant of text file should be like output of Print priview.
    Plese sugget with Function modules to cover as Text file.
    I am able to converting the Script output data to PDF and sending mail with attachment. So I don't want PDF file now.
    Thanks in advance.

    Hi, Thanks for responst.
    We can convert the Scirpt output to PDF file by using OTF function module and the PDF file looks like Print Privew output.
    Same like this I want Script out in NOTEPAD (.txt). Is that possible, Plz sugget with relavent Function Modules.
    Thanks.

  • We want to send a mail with attachment pdf file.

    Hi!!!
    We want to send a mail with attachment pdf file.
    The PDF file this is in the server sap.

    Hi,
    Pls check web logs like
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Send a mail with attached file .xls but i got file without

    i tried to send a mail with attached file .xls. but i am able to send the file , we recived the file without file name. please do the same
    thnaks in advance.
    END-OF-SELECTION.
    Populate message body text
    PERFORM POPULATE_EMAIL_MESSAGE_BODY.
    Send file by email as .xls speadsheet
    PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
    TABLES IT_MESSAGE
    IT_ATTACH
    USING P_EMAIL
    'Example .xls documnet attachment'
    'XLS'
    'filename'
    CHANGING GD_ERROR
    GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
    PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
    *& Form DATA_RETRIEVAL
    Retrieve data form EKPO table and populate itab it_ekko
    FORM DATA_RETRIEVAL.
    SELECT EBELN EBELP AEDAT MATNR
    UP TO 10 ROWS
    FROM EKPO
    INTO TABLE IT_EKPO.
    ENDFORM. " DATA_RETRIEVAL
    *& Form BUILD_XLS_DATA_TABLE
    Build data table for .xls document
    FORM BUILD_XLS_DATA_TABLE.
    CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
    CON_TAB TYPE X VALUE '09'. "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
    con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    con_cret type c value cl_abap_char_utilities=>CR_LF.
    CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
    INTO IT_ATTACH SEPARATED BY ''.
    CONCATENATE '' IT_ATTACH INTO IT_ATTACH.
    APPEND IT_ATTACH.
    LOOP AT IT_EKPO INTO WA_CHAREKPO.
    CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
    WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
    INTO IT_ATTACH SEPARATED BY ''.
    CONCATENATE '' IT_ATTACH INTO IT_ATTACH.
    APPEND IT_ATTACH.
    ENDLOOP.
    ENDFORM. " BUILD_XLS_DATA_TABLE
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
    PIT_ATTACH
    USING P_EMAIL
    P_MTITLE
    P_FORMAT
    P_FILENAME
    P_ATTDESCRIPTION
    P_SENDER_ADDRESS
    P_SENDER_ADDRES_TYPE
    CHANGING P_ERROR
    P_RECIEVER.
    DATA: LD_ERROR TYPE SY-SUBRC,
    LD_RECIEVER TYPE SY-SUBRC,
    LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
    LD_EMAIL LIKE SOMLRECI1-RECEIVER,
    LD_FORMAT TYPE SO_OBJ_TP ,
    LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
    LD_ATTFILENAME TYPE SO_OBJ_DES ,
    LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
    LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
    LD_RECEIVER LIKE SY-SUBRC.
    LD_EMAIL = P_EMAIL.
    LD_MTITLE = P_MTITLE.
    LD_FORMAT = P_FORMAT.
    LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
    LD_ATTFILENAME = P_FILENAME.
    LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
    LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
    W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
    W_DOC_DATA-OBJ_LANGU = SY-LANGU.
    W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
    W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
    W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
    CLEAR W_DOC_DATA.
    READ TABLE IT_ATTACH INDEX W_CNT.
    W_DOC_DATA-DOC_SIZE =
    ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
    W_DOC_DATA-OBJ_LANGU = SY-LANGU.
    W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
    W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
    W_DOC_DATA-SENSITIVTY = 'F'.
    CLEAR T_ATTACHMENT.
    REFRESH T_ATTACHMENT.
    T_ATTACHMENT[] = PIT_ATTACH[].
    Describe the body of the message
    CLEAR T_PACKING_LIST.
    REFRESH T_PACKING_LIST.
    T_PACKING_LIST-TRANSF_BIN = SPACE.
    T_PACKING_LIST-HEAD_START = 1.
    T_PACKING_LIST-HEAD_NUM = 0.
    T_PACKING_LIST-BODY_START = 1.
    DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
    T_PACKING_LIST-DOC_TYPE = 'RAW'.
    APPEND T_PACKING_LIST.
    Create attachment notification
    T_PACKING_LIST-TRANSF_BIN = 'X'.
    T_PACKING_LIST-HEAD_START = 1.
    T_PACKING_LIST-HEAD_NUM = 1.
    T_PACKING_LIST-BODY_START = 1.
    DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
    T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
    T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
    T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
    T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
    APPEND T_PACKING_LIST.
    Add the recipients email address
    CLEAR T_RECEIVERS.
    REFRESH T_RECEIVERS.
    T_RECEIVERS-RECEIVER = LD_EMAIL.
    T_RECEIVERS-REC_TYPE = 'U'.
    T_RECEIVERS-COM_TYPE = 'INT'.
    T_RECEIVERS-NOTIF_DEL = 'X'.
    T_RECEIVERS-NOTIF_NDEL = 'X'.
    APPEND T_RECEIVERS.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = W_DOC_DATA
    PUT_IN_OUTBOX = 'X'
    SENDER_ADDRESS = LD_SENDER_ADDRESS
    SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE
    COMMIT_WORK = 'X'
    IMPORTING
    SENT_TO_ALL = W_SENT_ALL
    TABLES
    PACKING_LIST = T_PACKING_LIST
    CONTENTS_BIN = T_ATTACHMENT
    CONTENTS_TXT = IT_MESSAGE
    RECEIVERS = T_RECEIVERS
    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.
    Populate zerror return code
    LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
    LOOP AT T_RECEIVERS.
    LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
    ENDLOOP.
    ENDFORM.
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    Instructs mail send program for SAPCONNECT to send email.
    FORM INITIATE_MAIL_EXECUTE_PROGRAM.
    WAIT UP TO 2 SECONDS.
    SUBMIT RSCONN01 WITH MODE = 'INT'
    WITH OUTPUT = 'X'
    AND RETURN.
    ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    Populate message body text
    FORM POPULATE_EMAIL_MESSAGE_BODY.
    REFRESH IT_MESSAGE.
    IT_MESSAGE = 'Please find attached a list test ekpo records'.
    APPEND IT_MESSAGE.
    ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY

    PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
      TABLES IT_MESSAGE
      IT_ATTACH
      USING P_EMAIL
      'Failed IDOC Analysis report'(020)
      'xls'(021)
      'IDOC_REP'(022)
      CHANGING GD_ERROR
      GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
    ENDFORM.                    " F_MAIL
    *& Form BUILD_XLS_DATA_TABLE
    Build data table for .xls document
    FORM BUILD_XLS_DATA_TABLE.
    *CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
    *CON_TAB TYPE X VALUE '09'. "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
      constants:
       con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
       con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE text-040 text-041 text-042 text-043 text-044 text-045 text-046 text-047 text-048 text-049
      INTO IT_ATTACH SEPARATED BY con_tab.
      CONCATENATE con_cret IT_ATTACH INTO IT_ATTACH.
      APPEND IT_ATTACH.
      clear IT_ATTACH.
      loop at i_final_t into w_final.
        CONCATENATE
        w_final-mestyp w_final-docnum  w_final-statxt w_final-msgno w_final-rvplant w_final-kunnr w_final-vbeln w_final-credat
                w_final-cretim w_final-flag INTO IT_ATTACH SEPARATED BY con_tab.
        CONCATENATE con_cret IT_ATTACH INTO IT_ATTACH.
        APPEND IT_ATTACH.
        clear IT_attach.
      endloop.
    ENDFORM. " BUILD_XLS_DATA_TABLE
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
    PIT_ATTACH
    USING P_EMAIL
    P_MTITLE
    P_FORMAT
    P_FILENAME
    P_ATTDESCRIPTION
    P_SENDER_ADDRESS
    P_SENDER_ADDRES_TYPE
    CHANGING P_ERROR
    P_RECIEVER.
      DATA: LD_ERROR TYPE SY-SUBRC,
      LD_RECIEVER TYPE SY-SUBRC,
      LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
      LD_EMAIL LIKE SOMLRECI1-RECEIVER,
      LD_FORMAT TYPE SO_OBJ_TP ,
      LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
      LD_ATTFILENAME TYPE SO_OBJ_DES ,
      LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
      LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
      LD_RECEIVER LIKE SY-SUBRC.
      LD_EMAIL = P_EMAIL.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT = P_FORMAT.
      LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
      LD_ATTFILENAME = P_FILENAME.
      LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PIT_ATTACH[].
    Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    Create attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
      T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
    Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        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.
    Populate zerror return code
      LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM.                    "SEND_FILE_AS_EMAIL_ATTACHMENT
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    Instructs mail send program for SAPCONNECT to send email.
    FORM INITIATE_MAIL_EXECUTE_PROGRAM.
      WAIT UP TO 2 SECONDS.
      SUBMIT RSCONN01 WITH MODE = 'INT'
      WITH OUTPUT = 'X'
      AND RETURN.
    ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    Populate message body text
    FORM POPULATE_EMAIL_MESSAGE_BODY.
      data: l1(99)    type c,
             l2(15)    type c,
             lt_message         type standard table of solisti1,
             ls_message      like line of lt_message.
      clear ls_message.
      l1 = 'Dear'(007).
      l2 =  'Sir/Madam'(008).
      concatenate l1 l2 ',' into
      ls_message-line separated by space.
      append ls_message to lt_message.
    *insert Blank Line
      clear ls_message.
      ls_message-line = space.
      append ls_message to lt_message.
    *Assign Message text
      clear ls_message.
      concatenate text-011
                  text-012
                  into ls_message-line separated by space.
      append ls_message to lt_message.
    *insert Blank Line
      clear ls_message.
      ls_message-line = space.
      append ls_message to lt_message.
    *Assign Message text
      clear ls_message.
      concatenate text-013
                  text-014
                  text-015
                  into ls_message-line separated by space.
      append ls_message to lt_message.
      concatenate text-016
                  text-017
                  into ls_message-line separated by space.
      append ls_message to lt_message.
    *insert Blank Line
      clear ls_message.
      ls_message-line = space.
      append ls_message to lt_message.
      ls_message-line = text-018.
      append ls_message to lt_message.
      ls_message-line = text-019.
      append ls_message to lt_message.
      clear: ls_message.
      REFRESH IT_MESSAGE.
      it_message[] = lt_message[].
      APPEND IT_MESSAGE.
    ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY

  • How to send a mail with attaching a report

    hi gurus,
        my requirment is i have to send a mail with attaching the report of a program to the client.. is it possible? help me with sample code.
    Thanks in advance.
    Regards,
    Indira D

    Hi Indira,
    plz check out this code below,
    *& Report  ZATTACH                                               *
    REPORT  ZATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
      Retrieve sample data from table ekpo
      PERFORM data_retrieval.
      Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    FORM build_xls_data_table.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
       con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
        CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.
    " POPULATE_EMAIL_MESSAGE_BODY
    <b>
    Reward points if this helps,</b>
    Kiran

  • Mail with attachment; dynamic receiver

    Hi everybody,
    we are sending a mail with attachment though mail adapter.
    In Micosoft Exchange the mail is received correct und the attachment is displayed.
    We got also a signature server.
    There the attachment is not regocnized.
    Any ideas.
    Is MS Exchange more error toleranting that onther mail servers?
    Any ideas are appreciated
    Regards Mario

    Hi,
    1) XML payload as attachment (with dynamic name)
    2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
    These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
    The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
    <?xml version="1.0"; encoding="UTF-8"?>
    <p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
    <Subject>My Invoice</Subject>
    <From>from email address<;/From>
    <To>to email address</To>
    <Content_Type>text/plain;name="MyFile.csv";</Content_Type>  --> file name here
    <Content>123;A49;aaa</Content>   -> attachment xml here
    </p2:Mail>
    And you have to select MailPackage in the receiver mail adapter.
    Regards,
    Aravind

  • Convert Screen(spool) to PDF file sending mail with attach file

    Hi :
    I'd like convert spool list to pdf and sending file...
    so, I read thread about spool convert to PDF before,
    and know how to convert Spool to PDF file and send mail with attach file.
    but I have a problem.
    my solution as:
    step 1. Call function: "CONVERT_ABAPSPOOLJOB_2_PDF"
    step 2. Call function: "SO_NEW_DOCUMENT_ATT_SEND_API1"
    then, I got a mail with attached PDF file, but the PDF file display limited 255 line.( SO_NEW_DOCUMENT_ATT_SEND_API1 limited)
    I want to showing word is wider that 255.
    and then I find a manual method as:
    After program finished.
    Function Menu -> system -> List -> Send
    use Prog: "Create Document and Send"
    I use this prog sending mail and attached file ,
    PDF file do <b>NOT</b> have 255 word limit !
    finally. my question is, If I want sending mail as Prog: "Create Document and Send", how to do?
    which Function I have to use?...
    Please help me, Thanks!

    Hi,
    Check this sample code of sending spool as attachment to an email address..
    Parameters.
    PARAMETERS: p_email(50) LOWER CASE.
    PARAMETERS: p_spool LIKE tsp01-rqident.
    Data declarations.
    DATA: plist         LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: document_data LIKE sodocchgi1.
    DATA: so_ali        LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA: real_type     LIKE soodk-objtp.
    DATA: sp_lang       LIKE tst01-dlang.
    DATA: line_size     TYPE i VALUE 255.
    DATA: v_name        LIKE soextreci1-receiver.
    DATA rec_tab        LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    Get the spool data.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
         EXPORTING
              rqident              = p_spool
              first_line           = 1
              last_line            = 0
              desired_type         = '   '
         IMPORTING
              real_type            = real_type
              sp_lang              = sp_lang
         TABLES
              buffer               = so_ali
         EXCEPTIONS
              no_such_job          = 1
              job_contains_no_data = 2
              selection_empty      = 3
              no_permission        = 4
              can_not_access       = 5
              read_error           = 6
              type_no_match        = 7
              OTHERS               = 8.
    IF sy-subrc <> 0.
      MESSAGE s208(00) WITH 'Error'.
      LEAVE LIST-PROCESSING.
    ENDIF.
    Prepare the data.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 0.
    plist-body_num = 0.
    plist-doc_type = 'RAW'.
    plist-obj_descr = 'Test ALV'.
    APPEND plist.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 1.
    DESCRIBE TABLE so_ali LINES plist-body_num.
    plist-doc_type = real_type.
    Get the size.
    READ TABLE so_ali INDEX plist-body_num.
    plist-doc_size = ( plist-body_num - 1 ) * line_size
                     + STRLEN( so_ali ).
    APPEND plist.
    Move the receiver address.
    MOVE: p_email  TO rec_tab-receiver,
          'U'      TO rec_tab-rec_type.
    APPEND rec_tab.
    IF NOT sp_lang IS INITIAL.
      document_data-obj_langu = sp_lang.
    ELSE.
      document_data-obj_langu = sy-langu.
    ENDIF.
    v_name = sy-uname.
    Send the email.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
         EXPORTING
              document_data              = document_data
              sender_address             = v_name
              sender_address_type        = 'B'
         TABLES
              packing_list               = plist
              contents_bin               = so_ali
              receivers                  = rec_tab
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 8.
    IF sy-subrc <> 0.
      MESSAGE e208(00) WITH 'Error'.
    ENDIF.
    COMMIT WORK.
    Send the email immediately.
    SUBMIT rsconn01
    WITH mode = 'INT'
    AND RETURN.
    Thanks,
    Naren

  • C3-01 can´t delete mails with attachment

    Hi,
    since one week I have the C3 touch & type. It`s a very nice mobile phone. But I have a problem: I can not delete mails with attachment in the mail programm. Mails without attachment are no problem. I have an mailaccount from "1und1" (Germany). Has anybody an idea, how I can solve this?
    Thanks alot.
    pastores

    The only way I've been able to delete them is to delete the email account from the phone, then add the account, again.
    Pretty painful solution.

  • Send mail with attachement

    i want to send mail with attachements. does wwv_flow_mail.send support this feature? how to do it?
    thanks,

    Please check this thread..
    Re: sending mails with attachment
    Hope this helps.
    Thanks

  • Regarding mail with attached file

    hi experts,
              i am doing on a report where mail with attached file should fire everyday at 9am. when i am doing it in background,mail is sent to everyone with attached file but when i schedule it in background,mail is firing but attached file is missing.how can i solve this problem?
    thanks.

    try to place ur file onn application server when u run BC.
    Thanks
    Kiran

  • Adf Mail with Attachment

    Hi Experts,
    i'm Using Jdeveloper 11.1.1.5.0.
    My Scenario is to send a mail with Attachments from Adf Application.
    I have sent a Mail Without attachment from Adf Application, it works fine.
    But, it have to send a mail with Attachment.
    Anyone Guide me

    Cvele_new_account
    Thank for your Reply
    I'm Using Jdeveloper 11.1.1.5.0
    I am   using the following Code for send a mail without Attachment from Adf Application.
    Mail Sent Successfully.
    Code:
        public String send(String SMTPhost, String From,   String To,   String Subject,  String Body,  String Attachment,  String Username,   String Password,    String Port, String filename1)
                              String  to= To, subject = Subject , from = From ,
                              cc = null, bcc = null,  url =null;
                              String mailhost = SMTPhost;
                              String  user = Username , password = Password;
                              boolean debug = false;
                              boolean verbose = false;
                              boolean auth = true;
                              String prot = "smtp";
                              try{
                                  String filename = System.getProperty("java.home")+"/lib/security/cacerts".replace('/', File.separatorChar);
                                  String password2 = "xxxxxxxxx";
                                  System.setProperty("javax.net.ssl.trustStore",filename);
                                  System.setProperty("javax.net.ssl.trustStorePassword",password2);
                              Properties props = System.getProperties();
                              props.put("mail." + prot + ".host", mailhost);       
                              props.put("mail." + prot + ".auth", "true");
                              props.put("mail.smtp.starttls.enable", "true");
                              props.put("mail.smtp.port", Port);
                              // Get a Session object
                              Session session = Session.getInstance(props, null);
                              if (debug)
                                  session.setDebug(true);
                              Message msg = new MimeMessage(session);
                              if (from != null)
                                  msg.setFrom(new InternetAddress(from));
                              msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
                              if (cc != null)
                                  msg.setRecipients(Message.RecipientType.CC,
                                                          InternetAddress.parse(cc, false));
                              if (bcc != null)
                                  msg.setRecipients(Message.RecipientType.BCC,
                                                          InternetAddress.parse(bcc, false));
                              msg.setSubject(subject);
                              String text = Body;
                              msg.setText(text);
                                  MimeBodyPart messageBodyPart = new MimeBodyPart();
                                  String filename2 = "D://" + filename1;
                                      System.out.println("Exact path--->" + filename2);
                                      DataSource source = new FileDataSource(filename2);
                                      messageBodyPart.setDataHandler(new DataHandler(source));
                                      messageBodyPart.setFileName(filename2);
                                  Multipart multipart = new MimeMultipart(filename1);
                                  multipart.addBodyPart(messageBodyPart);
                                  msg.setContent(multipart);
                                    SMTPTransport t =
                                  (SMTPTransport)session.getTransport(prot);
                              try {
                                  if (auth)
                                      t.connect(mailhost, user, password);           
                                      t.sendMessage(msg, msg.getAllRecipients());
                              finally {
                                  if (verbose)
                                      System.out.println("Response: " + t.getLastServerResponse());
                                  t.close();
                              FacesMessage fm = new FacesMessage("Mail has been sent successfully.");
                              fm.setSeverity(FacesMessage.SEVERITY_INFO);
                              FacesContext af = FacesContext.getCurrentInstance();
                              af.addMessage(null, fm);
                              System.out.println("\nMail was sent successfully.");
                              catch(Exception e){
                                  e.printStackTrace();
        return "Success";
        public String SendMail() {
           send(SMTPhost, From, To, Subject, Body, Attachment, Username, Password, Port,filename1);
            return null;
    But, it throws exception while sending with  attachments.
    java.io.IOException: No content
      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:930)
      at com.rits.suplr.view.backing.Mail.send(Mail.java:169)
      at com.rits.suplr.view.backing.Mail.SendMail(Mail.java:193)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.el.parser.AstValue.invoke(Unknown Source)
      at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
      at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
      at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
      at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
      at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:902)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:313)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:186)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
      at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Anyone Guide Me

  • "New Mail with attachment" function gone?

    I just installed Mountain Lion and I pretty much love it, although, I can't find a function, when you right-click the file, in LION it used to give me the option "New Mail with Attachment" or something like that. In Mountain Lion, this functionality's either gone, or I can't find it?
    thanks everybody

    yes I found other posts with the same problem. went to email preferences, general, and selected Mail 5.0 as a mail client and it worked. Thank you guys!
    ***you can delete this post now***

Maybe you are looking for

  • How do I number a Pages document in outline view

    I have a very long document done in outline view and I want to print it with pages numbers. They do not show up in the outline view. I have them in the regular (non-outline view) but they disappear when I go to outline view. The file is 50 pages long

  • Insert/Update/Delete Non-PO Invoice Line Item via FM/BAPI?

    Does anyone know of a way to insert/update/delete an Invoice Line item (Non-PO Accounting Invoice - Transaction FB60 or FV60) using a BAPI or Function Module (or set of function modules) using ABAP? I have been trying to find some code to accomplish

  • Adding a click box for a pop up on a quiz page

    I would like to add a pop-up scenario review on a quiz page so that those doing the elearning can review the case history.  I have the file saved as a pdf and it allows it to pop-up on other pages of the learning module but I can't figure out how to

  • Create new BPS documents from "COPY DOCUMENTS" user exit.

    Hi Gerd, thank you so much for your reply. I'm continuing other thread here. (Copy "document icon" to new sheet from "SEM-BPS 1" sheet) <b> We've a layout that doesn't use macros. </b> We'd like to attach a document for each line that is entered on t

  • Add Query Error in Sap Dashboard

    Dear All, I have downloaded the trail version of SAP Dashboard.I would like to add a query and create a dashboard.But it is not accepting the authentication details. Kindly Suggest. Does Trial version support creating of demos from Query. Thanks, Mer