Email os file as attachment

I want to send os file as attachment using utl_mail package , how can I do this.
Regards

Preferable by using FAQ resources first like http://www.orafaq.com/wiki/Send_mail_from_PL/SQL
Life can be so simple when you know how to use available resources!!!
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Email XML file as attachment in 4.6c

    Hi,
    I have a requirement to generate an XML file and email it.
    I am using Class CL_IXML to create the xml requirement.  The code is listed below
    When I download the file to the PC, i am able to open the file and the XML format is ok, but when
    I email the file using SO_NEW_DOCUMENT_ATT_SEND_API1, the attachment is still in the Binary format. Does anyone know how to send the file as an XML attachment.
    We are using SAP R/3 ver 4.6c.
    Load the class definition
      CLASS cl_ixml DEFINITION LOAD.
          Creating a ixml factory
      l_ixml = cl_ixml=>create( ).
          Creating the dom object model
      l_document = l_ixml->create_document( ).
    Message
      l_element_message  = l_document->create_simple_element(
                    name = 'Message'
                  parent = l_document ).
    Message Header
      l_element_message_hdr  = l_document->create_simple_element(
                        name = 'MessageHeader'
                      parent = l_element_message ).
    Sender Id
      l_element_dummy = l_document->create_simple_element(
                 name = 'SenderID'
                value = 'ABCDE'
               parent = l_element_message_hdr ).
    Receipient Id
      l_element_dummy = l_document->create_simple_element(
                 name = 'RecipientID'
                value = 'ZZZZZZZZZZZ'
               parent = l_element_message_hdr ).
    Prepared
      l_element_dummy = l_document->create_simple_element(
                 name = 'Prepared'
                value = '2009-03-31T14:30:00'
               parent = l_element_message_hdr ).
    Msg ID
      l_element_dummy = l_document->create_simple_element(
                 name = 'MessageID'
                value = '1234567896'
               parent = l_element_message_hdr ).
    Msg type
      l_element_dummy = l_document->create_simple_element(
                 name = 'MessageType'
                value = 'MANIFEST'
               parent = l_element_message_hdr ).
    Msg ver
      l_element_dummy = l_document->create_simple_element(
                 name = 'MessageVersion'
                value = '02'
               parent = l_element_message_hdr ).
      Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      Connect internal XML table to stream factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
      Rendering the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                                           document = l_document ).
      l_rc = l_renderer->render( ).
      Saving the XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    Thanks
    ND

    Hi,
      I have one program conerts data to xml format.
    TABLES:
      MAKT,                                "Mat description
      MARC,                                "Material / plant
      T001W,                               "plant name
      BHDGD.                               "Batch heading
    Internal tables
    DATA:
      BEGIN OF GT_MARC OCCURS 0,
        WERKS LIKE MARC-WERKS,
        MATNR LIKE MARC-MATNR,
      END OF GT_MARC,
    Table to be downloaded as xml. Each line stores start and end tags
    and the value
      BEGIN OF GT_XML OCCURS 0,
        LINE(120),
      END OF GT_XML,
      G_MAKTX(120).
    User-input
    SELECT-OPTIONS:
      S_WERKS FOR MARC-WERKS,
      S_MATNR FOR MARC-MATNR.
    START-OF-SELECTION.
    Extract all required data
      PERFORM MAIN_PROCESSING.
    END-OF-SELECTION.
      SORT GT_MARC BY WERKS MATNR.
      LOOP AT GT_MARC.
        AT FIRST.                          "First tag must be root
          CLEAR GT_XML.
          GT_XML-LINE = ''.
        APPEND GT_XML.
        CLEAR GT_XML.
    display data
        FORMAT COLOR 2 ON.
        WRITE :/ GT_MARC-MATNR, MAKT-MAKTX.
        FORMAT COLOR 2 OFF.
      ENDLOOP.
    The last tag must be the root closing tag --*
      GT_XML-LINE = '</LOCATIONS>'.
      APPEND GT_XML.
      CLEAR GT_XML.
      CALL FUNCTION 'DOWNLOAD'
           EXPORTING
                FILENAME = 'C:PLANT1.XML'
                FILETYPE = 'ASC'
           TABLES
                DATA_TAB = GT_XML.
    TOP-OF-PAGE.
      MOVE SY-TITLE TO BHDGD-LINE1.
      MOVE SY-REPID TO BHDGD-REPID.
      MOVE SY-UNAME TO BHDGD-UNAME.
      MOVE SY-DATUM TO BHDGD-DATUM.
      MOVE '0' TO BHDGD-INIFL.
      MOVE '132' TO BHDGD-LINES.
      FORMAT INTENSIFIED ON COLOR COL_HEADING.
      PERFORM BATCH-HEADING(RSBTCHH0).     "report header
    Form READ_PLANT
    FORM READ_PLANT.
    Get plant name
      CLEAR T001W.
      SELECT SINGLE NAME1
        INTO T001W-NAME1
        FROM T001W
       WHERE WERKS EQ GT_MARC-WERKS.
    ENDFORM.                               " READ_PLANT
    Form MAIN_PROCESSING
    FORM MAIN_PROCESSING.
    Material and plant basic data
      SELECT WERKS MATNR
        INTO TABLE GT_MARC
        FROM MARC
       WHERE WERKS IN S_WERKS
         AND MATNR IN S_MATNR.
    ENDFORM.                               " MAIN_PROCESSING
    Form READ_DESCRIPTION
    FORM READ_DESCRIPTION.
    Material name
      CLEAR G_MAKTX.
      SELECT SINGLE MAKTX
        INTO G_MAKTX
        FROM MAKT
       WHERE MATNR EQ GT_MARC-MATNR
         AND SPRAS EQ 'E'.
    Replace special character
      DO.
        REPLACE '&' WITH '*ù%;' INTO G_MAKTX.
        IF NOT SY-SUBRC IS INITIAL. EXIT.ENDIF.
      ENDDO.
      DO.
        REPLACE '*ù%;' WITH '&amp;' INTO G_MAKTX.
        IF NOT SY-SUBRC IS INITIAL. EXIT.ENDIF.
      ENDDO.
      DO.
        REPLACE '/' WITH '&#47;' INTO G_MAKTX.
        IF NOT SY-SUBRC IS INITIAL. EXIT.ENDIF.
      ENDDO.
    ENDFORM.                               " READ_DESCRIPTION
    END OF PROGRAM Z_DOWN_XML ************************
    *******For sending data to mail check the following link*****
    http://itknowledgeexchange.techtarget.com/itanswers/is-there-an-xml-function-module/
                                              (OR)
    search in sdn.sap.com for mail data(xml)

  • Cannot delete file from disk after emailling that file like attachment

    After i send some file from disk in Mail like attachment i cannot delete that file from disk unless i quit Mail. Like Mail is still using a file. Of course, that mail is in Sent mail, not in outbox.

    This deeper than that. I created another account on the same iMac and it works in Harmony with my other devices and Documents in the cloud. I can only imagine the icloud account is somehow corrupted (I am on my macbook not iMac at the moment). There have been no updates to the Calendar, Contacts or Documents since early January on that account. I have spent 1hr on the phone with support and they were baffled as well. Only thing I can gove as insight to the problem is this, I was on the Mac Mini which was backed up on Time Machine. about 4 or 5 months ago I had to completley restore the Mac Mini becasue of the never ending circle on the load screen. The Backup failed to work it kept loading the issue and 4 or 5 times the circle of death kept coming up I would subsequently wipe the Mini and go further back in the back up until I go a copy that worked.  I then loaded the Time Mache back up into my NEW iMac and wnet from there. It took about a month for this problem I am detailing above to start happening. It maybe a corrupt file loaded from the backup into the new iMac causing this problem. Best answer I can think of on my own???

  • How can I attach a picture to an email in file format not as a picture

    how can I attach a picture to an email in file format,

    Please pardon the intrusion…
    Hi, Leroy! 
    Congratulations on advancing to Level 6!
    At the Water Cooler in the Level 6+ Lounge, we are throwing virtual confetti in celebration of your attainment of Level 6-dom. Would you care to join us at the Water Cooler?
    Towards the bottom of the index on the Apple Support Communities Home Page you soon will find the Lounge link available to you. It should work for you within the next 24 hours if all goes as it should.
    Hope to see you there soon!

  • I have Windows 7, Microsoft Outlook and PSE 13. I have used the "Share photos as embedded images" feature frequently, but today when I went to use it, it wasn't there, only the option to send email with files attached. How do I get back the ability to sen

    I have Windows 7, Microsoft Outlook and PSE 13. I have used the "Share photos as embedded images" feature frequently, but today when I went to use it, it wasn't there, only the option to send email with files attached. How do I get back the ability to send emails with photos embedded. I like adding the frames and backgrounds and I think it's easier for recipients to look at the photos. Thanks for any suggestions of things to try.
    Gail

    I had a similar problem in that my wife's iphone 5 could not send pics with imessage.  Had to set the settings to default to SMS or whatever.  After laboring many hours on the web I coincidentally was on the phone with the internet people to question my internet speed.  They changed the router channel, which is something that I am capable of doing myself.  After that, the pics go over imessage.  My own Iphone didn't have the problem.  We are both latest IOS 7.0.6.

  • My HP Officejet 8500a All-In-One forwards faxes (as a tiff file) to my iphone.  Can only view/receive 1st page, embedded into email as a non-attachment.  Iphone receives email(s) pdf attachments well.  What can I do?

    My HP Officejet 8500a All-In-One forwards faxes (as a tiff file) to my iphone.  Can only view/receive 1st page, embedded into email as a non-attachment.  Iphone receives email(s) pdf attachments well.  What can I do?

    Try this app
    http://itunes.apple.com/us/app/fax-reader/id406902152?mt=8

  • Why can I not attach a document to an email? Every time I want to send an email with a document attached to it, an error notice pops out. It tell me that the file is being used even when  it is not. How can I fix this issue?

    Why can I not attach a document to an email? Every time I want to send an email with a document attached to it, an error notice pops out. It tells me that the file is being used even when  iall other programs are closed. How can I fix this issue?

    Thanks Jeff, I was not aware that a template could be multi-page.  (All the existing templates were 1 page)
    But it worked, saving me some steps.  When I was finished I renamed the document, and locked it.
    Then tried to save it but  could not because it was locked.  I closed it, went to my Spread Sheet Folder ,
    to find it, it was not there.  The Finder could not find it either.
    So I start over again.
    I opened up Numbers and it showed my personal Numbers template folder, it contained both my new 
    original 4 page template and the vanished saved document!
    I tried to delete the template containing these document data and could not - I had to go to the Library/Application Support/Numbers to physically remove it from this folder. Then I started over again.  I Finally found out how to make it work: I can now "save as", and then lock, and it will go to place where I want it to be saved and locked.
    The secret is: Click on the document title in the menu bar, and it opens up  "Save as...", which works the same as in OS 10.4.11, and you can pick the place you want for saving.  Once done that, you can then lock the document in the same pull down menu, and then close it.
    I also found later that I can delete a template from its folder, by letting Numbers open the templates,
    clicking on the one I want to remove, then go to the "Numbers Menu/File/Move to...", select "Desktop"
    and from there the selected template can then be thrown into the Trash from there.
    It appears now that the real fault of the Numbers software is that the "Save as" command is not available in the "Edit" or "File" pull-down menus, but hidden behind the title of the document.

  • How to  email a file in application server as attachement

    I need your help in sending mail in ABAP4.
    Please provide me some help on this.
    I have some files in the server eg. /tmp/file1 and /tmp/file2
    I want to zip those 2 files file1 and file2 into a single file namely output.zip and email output.zip as attachment.
    Thanks,
    Kasi
    Message was edited by:
            Kasi Reddy

    Hi,
    Check this code..GIve the input file path and give the email address...Then execute..
    PARAMETERS: p_file(50) LOWER CASE.
    PARAMETERS: p_email(50).
    START-OF-SELECTION.
    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 file data.
      OPEN DATASET p_file FOR INPUT IN TEXT MODE.
      IF sy-subrc <> 0.
        MESSAGE s208(00) WITH 'Error in opening file'.
        LEAVE LIST-PROCESSING.
      ENDIF.
      DO.
        READ DATASET p_file INTO so_ali-line.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND so_ali.
      ENDDO.
      CLOSE DATASET p_file.
    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 = 'RAW'.
    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

  • I need to save an online file to my ipad and then email it as an attachment from my school email? It is my college gmail account and I can't add it to my mail app.

    I need to save an online file to my ipad and then email it as an attachment from my school email? It is my college gmail account and I can't add it to my mail app. This was an assignment for class to make sure we could use the BB email system.

    You can use your gmail account within the native Mail app using IMAP
    Make sure you've enabled IMAP in your main Gmail settings
    Open the Settings app on your device
    Tap Mail, Contacts, Calendars
    Tap Add Account...
    Tap Gmail
    Enter your account information, being sure to use your full Gmail address, including '@gmail.com'
    Tap Next
    Tap Save

  • Running Safari 6.0.3  When trying to print files using Adobe Reader 11.0.02, print preview screen is all black.  If files are attached to an email, receiver can't open it.  It does work OK in Firefox 19.0.2  Any ideas?

    Running Safari 6.0.3  When trying to print files using Adobe Reader 11.0.02, print preview screen is all black.  If files are attached to an email, receiver can't open it.  It does work OK in Firefox 19.0.2  Any ideas?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Attempted to mail an email with a large attachment file.  One of the addresses was bad.  When my Outlook is running, the Mac tries to send it and shows the progress.  However, when I look in my Outbox the files are not there.  It does show up in the Outb

    attempted to mail an email with a large attachment file.  One of the addresses was bad.  When my Outlook is running, the Mac tries to send it and shows the progress.  However, when I look in my Outbox the files are not there.  It does show up in the Outbox progress section but I can not delete it when it is there.
    Where do these files reside?
    Is there a hidden Outbox??
    MacBook Pro, Mac OS X (10.7.1)

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Shell Script to send email with .txt file as attachment

    Dear Al,
    Could any one help me with code, for sending email with .txt file as attachment using shell script.
    Thank You!

    978334 wrote:
    Dear Al,
    Could any one help me with code, for sending email with .txt file as attachment using shell script.
    Thank You!http://bit.ly/XHfSCz
    https://forums.oracle.com/forums/search.jspa?threadID=&q=sendmail&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • IPAD3/IPAD2 :PDF files/ attachments  sent in an email  displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend's

    IPAD3/IPAD2 :PDF files/ attachments  sent in an email  displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend’s PC. How do i get both my IPAD devices to display the PDF icons/attachments? Bearing in mind if i open the same email over the internet the PDF Icons/attachments display OK!
    Has anyone come across this? Your advice/help would be most appreciated

    This happens to me all the time.
    If is a one page PDF it seems as though it comes over already open and inline in the body of the email. Multiple page PDF files show as the PDF icon.
    I can't find any official documentation of this - other than based on my own experience with PDF attachments in my various email accounts.
    Message was edited by: Demo

  • I am unable to create adobe file from attached document from email

    I am unable to create adobe file from attached document from email. No 'open in' link is available as given in directions. What to do?

    Because there is no abode on the IOS.  you'll need to do a search in the app store to resolve your issue.

  • How to send txt file  as attachement in email

    Hi Experts ,
    How to send  txt file  as attachement in email .
    which function module i use

    Hi,
    Try to use this one
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    Hope it can solve your problem!
    Good luck!
    Tao

Maybe you are looking for

  • I run System 10.5.8 on a Mac and receive the reply "You can't open the application 'Firefox.app' because it is not supported on this architecture."

    I always update to your newest Firefox configuration and did so when I was asked to upgrade to "Firefox 4" for the Mac. When I tried to access my account I receive the above message. I dumped the upgrade which wiped my Mac clean of all my bookmarks a

  • IPhone 4S only powers up, works, when connected to wall power

    Brand new iPhone 4S, arrived two days ago on the model's launch day.  Few glitches, expected w/ new phone, not a big deal, worked through them, initially did restore-type installation to transfer all info from old AT&T iPhone 3GS, still w/ AT&T.  It

  • Not displaying flash

    I spent 90 minutes in live chat yesterday without a resolution or follow up. Suddenly Firefox can not display video, animation, flash, etc. It replaces this with white space (no errors, no red X). I have uninstalled Firefox and reinstalled with no su

  • FORMS BUILDER 6i

    I am studying application development I had a practical case that is making a form that contains 3 canvases: 1st. A content canvas that has a text item on it that returns the username using GET-APPLICATION-PROPERTY built in. 2nd. A tabbed canvas with

  • OBI App 11.1.1.6.2 vs 11.1.1.5

    There seems to be a difference when OBIEE 11.1.1.6.2 and above dashboards are accessed through the two Mobile Applications. When accessed using the old 11.1.1.5 app the dashboard formats correctly and the entire dashboard can be viewed on a single IP