UTL_MAIL.send_attach_varchar2 add CrLf in attachment

I'm having problems with UTL_MAIL... I need to send a RTF document attached to an email. But UTL_MAIL seems to add CrLf first in the attachement!
If I try to send a realy simple file, just contailing 'Test' then the attachment will be chr(13)||chr(10)||Test. !!
What ever is wrong, is wrong in this code snip...
UTL_MAIL.send_attach_varchar2
sender => '[email protected]',
recipients => '[email protected]',
subject => 'Log',
MESSAGE => 'The attached file is the logfile. Please do not reply or respond to this e-mail, as it has been automatically generated.',
attachment => 'Test',
att_inline => FALSE,
att_mime_type => 'application/octet',
att_filename => 'log.txt'
I have tried differnet Mime types and file names.... But nothing seems to help...
I'm using a Oracle Xe 10.2.0.1.0.
Can anybody explain whats failing???

I don't know if this is the cause but why would anyone be on 10.2.0.1 this many years after so many patches have been released?
Also consider attaching your file as raw rather than text. Does that solve the problem?

Similar Messages

  • How to attach and email a text file using UTL_MAIL.SEND_ATTACH_VARCHAR2

    Hi im trying to attach a text file 'sample.txt' located in '\Test_Loc\New_Folder'
    Here is my code and my OS is Solaris and im using 10g R2
    CREATE OR REPLACE
    procedure test_v2 as
    Begin
    UTL_MAIL.SEND_ATTACH_VARCHAR2(
    sender => '[email protected]',
    recipients => '[email protected]',
    cc => null,
    bcc => NULL,
    subject => 'RE: Testing Attachment',
    message => 'TEST',
    mime_type => 'text/plain; charset=us-ascii',
    priority => 1,
    attachment =>'\Test_Loc\New_Folder\sample.txt',
    att_inline => TRUE,
    att_mime_type => 'application/octet' ,
    att_filename => 'demo.txt'
    end;
    Where am i going wrong? Please help me out
    Regards
    Vibhuti

    Hi,
    i can´t belive that no one is helping you out until now.
    If you found a Solution, let me know.
    I´m in search of the same Problem...
    Regards
    Lone

  • Utl_mail.send_attach_varchar2 issue

    If I try to execute package below on 10.2.0.2 (on Solaris 10), then the attachment I receive in the email has two rows where first row is empty and the second row has a text 200708, aaaa, xxxx
    Any idea why? The attachment should have only one single row with text 200708, aaaa, xxxx why there are two rows and the first is empty?
    BEGIN
    utl_mail.send_attach_varchar2( sender => '[email protected]',
    recipients =>'[email protected]',
    subject => 'TEST',
    message => 'This is a test',
    attachment => '200708, aaaa, xxxx',
    att_filename => 'test.txt');
    END;

    Interesting, I get the same results running your code. The attached file has a leading blank line. Double checking the mail file in a hex editor shows that there is indeed an extra CRLF preceding the text that should be the body of your message. This is probably a bug in the implementation of the UTL_MAIL package that you could request help with from customer support. If you don't want to go through customer support, your other option would be to fore go using UTL_MAIL and instead go straight to UTL_SMTP, or grab a copy of the DEMO_MAIL package from OTN.

  • Getting bad argumnet error when using UTL_MAIL.SEND_ATTACH_VARCHAR2

    HI
    This is my code. I dont know what I am missing. Please advice. RK
    begin
    UTL_MAIL.SEND_ATTACH_VARCHAR2(
    sender => '[email protected]'
    ,recipients => '[email protected]'
    ,cc => null
    ,bcc => NULL
    ,subject => 'RE: Testing Attachment'
    ,message => 'Dear Providers: '
    || 'Let us know any changes in schedule'
    ,mime_type => 'text/plain; charset=us-ascii'
    ,priority => 1
    ,attachment => 'TEST'
    ,att_inline => TRUE
    ,att_mime_type => 'application_octet'
    ,att_filename => 'text.txt'
    end;
    ERROR at line 1:
    ORA-29261: bad argument
    ORA-06512: at "SYS.UTL_TCP", line 28
    ORA-06512: at "SYS.UTL_TCP", line 257
    ORA-06512: at "SYS.UTL_SMTP", line 116
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 228
    ORA-06512: at "SYS.UTL_MAIL", line 382
    ORA-06512: at line 3

    A new file text.doc will be created but is it possible to send already created file as an attachment file
    can u please mail me at [email protected]

  • Can we add a new attachment to an existing SC from any other custom page in SoCo PO View

    Hi Experts,
    Need your expert advice on the below requirement.
    We have created a custom view in SoCo PO page. There we have a New custom view called Notes&attachement.which contains same value from Notes & attachment of Shopping Cart.
    We are updating existing Notes of SC by FM 'bbp_pd_sc_update' and same is reflected in SC of same item guid & same header guid.
    Similarly trying to add a new Attachment to already existing attachment. New attachment is reflected in custom page and the describe link is working perfectly. but if come out of SoCo page , lets say in SC the new added attachment is shown but display_url,phio_size etc are not stored properly in DB.
    in bbp_pd transaction every thing looks same for new and existing attachment. we are using same FM 'BBP_PD_SC_UPDATE' by passing new internal table of attachment in import statement. Even 'BBP_PROC_DOC_UPADTE' has same result that is attachment is partially updated.
    Suppose, SC has one attachment at the time of creation. then adding a new attachment in custom view of SoCo PO page then every thing works fine in SoCo PO page but out of that SoCo PO or in SC the newly added attachment is not properly updated.
    I have added mime_type,phio_size,disp_url,file_name,file_ext,ev_content of new attachment in existing attachment internal table and calling above FM for update.
    Can we  add new attachment outside SC to existing SC ? if yes , then how?
    Thanks,
    Partha

    Hi Partha,
    Please post this query in the category: SAP SRM. Your post currently shows up on the forum - SRM User Interface Add-on. As your query is not related to the new ad-on, you might not get as many responses in this forum as you would have if you had posted the query in the general SRM forum (http://scn.sap.com/community/srm).
    Hope this helps
    Cheers,
    Yateesh

  • How to add a normal attachment in my apple mail?

    Apple mail is so slow when I want to add attachment to my message. I think the reason is that when I add eps file or other files, apple mail does not simply add it, but integrating it into my context. But I don't need it to do that. And because the process is so slow(my eps file is kind of large...), it wastes a great amount of my time doing it. So far I'm satisfied with other functionalities of this software so I really don't want to give it up easily.
    So, any one know if there is a simple way to add a normal attachment into apple mail message? Like what we usually do in any other email client? Thanks.

    Try turning them into a zip file before attaching. From Finder Help:
    Compress and uncompress files and folders
    Compressed files take up less disk space than uncompressed files, so compressing is useful for making backup copies of your data or for sending information over the Internet.
    To compress a file or folder, Control-click it or tap it using two fingers, and then choose Compress from the shortcut menu.If you compress a single item, the compressed file has the name of the original item with the .zip extension. If you compress multiple items at once, the compressed file is called Archive.zip.
    To uncompress (expand) an item, double-click the .zip file.

  • How to attach multiple files in UTL_MAIL.SEND_ATTACH_VARCHAR2 method

    Hi all ,
    I had written a pl/sql where it will write multiple csvs i.e. a.csv,b.csv,c.csv,d.csv to a location using UTL_FILE to reports folder .
    How do i attach a.csv,b.csv,c.csv,d.csv into a single mail ??
    UTL_MAIL.send_attach_raw (sender => '[email protected]',
    recipients => 'recepient.com.sg',
    subject => 'Reports',
    MESSAGE => 'Reports are attached above',
    mime_type => 'text/html; charset=UTF8',
    attachment => a.csv,
    att_inline => FALSE,
    att_filename => file1
    Edited by: 907812 on 12-Jan-2012 23:03
    Edited by: 907812 on 12-Jan-2012 23:03
    Edited by: 907812 on 12-Jan-2012 23:04
    Edited by: 907812 on 12-Jan-2012 23:04

    UTL_MAIL does not work like that - you pointing to an external file and telling it to grab it and attached it to your e-mail.
    If you refer to the manual, the attachment parameter specifies it must contain the contents of the file.
    So your code needs to open the file. Your code needs to read the contents of the file. Your code needs to close the file. Your code needs to supply the contents text to UTL_MAIL via the attachment parameter.
    And as there is only a single attachment parameter, only a single file's contents can be supplied as attachment.
    Multiple attachments? Then you need to do what UTL_MAIL does. You need to write code that creates a valid e-mail Mime body. The Mime body must allow for multiple attachment. The Mime body needs to be delivered as an e-mail via the UTL_SMTP package.

  • How to add "Comments" and attach files onto a form?

    My server is LiveCycle ES 2.5, trial version, Turnkey install / Express mode  with  Reader Extensions.
    Client side has IE8 and Reader X 10.1.2.
    User interface is the standard out-of-the-box WorkSpace ES.
    I have an application that routes a PDF form through a Workflow,
    the input/output of the User Tasks is a Document variable that points to the PDF form.
    I know that in the WorkSpace, ther's a built-in Attachment "tab" where the user can attach files and get them routed along with the form.
    But how about Reader's "attach file" (the paper clip) and annotations (the yellow sticker)?  how to allow users to use those features?
    I tried it in the WorkSpace, and when the form is loaded in the IE window, those features were disabled.
    How to enable them?
    Do I need to modify the standard Render service? and add 'Apply Usgae Rights' or something?
    is there an easier way that I missed?
    thanks

    Attachments are lost if your form submits as XDP. If you change the submit type to PDF then server that same PDF back to the next user, the attachments will be there. If you decide for other reasons, you still want to submit as an XDP, take a look at this: http://forums.adobe.com/message/4316578#4316578

  • Add and Transfer attachment from purchase Requisition to Purchase order

    Hi,
    We have implemented ECC 6.0. Our requirement is to add external docs as attachments to PR and these should transferred to PO, later to be submitted to the vendor.
    We have some info about the badi ME_PROCESS_PO_CUST. is this the right BAdi or do we need look for some other badi.
    Also the services for object is displayed only in the change mode, not during creation of PR.
    Any inputs will be appreciated.
    regards,
    AK

    Hi Muthu,
    I understand that it is possible to bring attachments from ECC to the SRM system for the new release.
    However, I have a slightly different question.
    If I want to bring in requirements from a legacy system to SRM 7.0 system directly, what is the feasability of the same? If I have an attachment linked in the legacy system, then is it possible to bring it in SRM 7.0 system directly or will I be forced to route it to ECC 6.0 and then use the Plan Driven Procurement scenario for getting it into SRM?
    Regards,
    Abhilash

  • Is there an add on to attach a hyperlink to a word or phrase

    Say you are making a comment on a web page or blog and want to attach a hyperlink to a word or phrase - is there an add on for Firefox to do this

    There might be an add-on for this. You could try searching [https://addons.mozilla.org/firefox/ the Add-ons site].
    This is a little more complicated than it may appear, though, because different sites use different mark-up codes for links. For example, this site works similarly to Wikipedia, but most forum sites use BBCode tags. Still others may allow pure HTML. Not sure about blogs (and any comment with a link may be held for moderation as an anti-spam strategy, so keep that in mind).
    What probably is simplest, if it's available, is to look for a link button above or next to the form you are commenting in. Then you can paste the URL of the destination page and be assured that the site will handle the formatting details.
    Does that help? Are there particular sites where you need this feature?

  • How to add a custom Attachment Category

    Hi All,
    When we add Attachement in standard apps pages( by clicking on Add Attachment Button)
    The Attachment Page will be opened,
    */oracle/apps/fnd/framework/attachments/webui/FND_ATTACH_UPLOAD_PAGE*
    When you add the attachments, you can mention the Category(from message choice, which will be pickup from a VO
    (oracle.apps.fnd.server.FndCategoryNameVO)
    I would like to add a custom category. How to add it.
    I have got an option of Adding a new category from "Application Developer" -> "Attachments" -> "Categories"
    I could add the categories, But how to get those newly added categories in a standard apps page,
    Eg. /oracle/apps/pon/negotiation/creation/webui/ponDefineHdrPG
    Thanks.
    With Regards,
    Kali.

    If you're talking about a playback controller within the rich media annotation (RMA) then you need to write your own widget in Flash or Flex, and then place the video and widget files using the multimedia "Add Flash" tool in Acrobat instead of the "Add Video" tool. Aside from a bunch of proprietary code to handle events, commenting and the API (which you can live without for basic play-pause-scrub applications), video RMAs are just an embedded SWF file containing an FLVPlayback component. The skin and the video file itself are added to the RMA as resource entries. You can build your own version and have it display whatever controls you want, provided you know how to write ActionScript!
    If you're talking about a controller that's external to the RMA (e.g. a series of links or buttons elsewhere on the page) then in the past you would use FLV video files and the 'cue points' feature that's built into Acrobat - however Adobe removed the ability to create FLV files in the latest version of CC, so unless you have CS6 or earlier it's a non-starter. Instead you can manually set playback start points using the special "multimedia operations" link action in your PDF - though stopping playback at a defined point is very difficult without FLV cues. For that you're back to writing your own widget.

  • Add CRLF after a string reaches a certain length (in inches)

    I have this function to calculate the length of the string in inches.
    I would like to know how can I add a line break or CRLF right after X length and not to break any words in the string.?
    Thank you in advance,
    apexsan

    Hi,
    SQL knows nothing about what font you're using. I don't know of anything built into Oracle SQL where you can specify font information.
    There may be something specific to your front end, such as Apex. If that's what you're using, then mark this thread as "Answered", and then open a new thread in the Oracle Application Express (APEX).
    This wouldn't be a hard thing to do in PL/SQL if you knew the width of each character. If you had a flat file or a spereadsheet that listed each character and its width, you could load that into a table, and write a function (perhaps a pipelined function) that, given a string, a scale and a field width, split the split into the longest possible pieces no longer than the field width.

  • Add columns to attachment overview

    Hi gurus,
    On SRM portal I've added an attachment to the shopping cart and I see the columns:
    Description  Category  Version  Processor  Typ  File Size (Kb)  Inter.  Changed By  Changed on 
    I want to add a few columns, how do I do this? I've searched for BaDI's but I cannot find the correct one.
    I've also added some extra fields in the ECC system with CL02 and CT04 to a document type. How are those fields shown in SRM? I cannot see any reference.
    Kind regards,
    Wim van Erp

    hi,
    Please send mail to SAP service desk with screen shots of earlier version and new version mentioning the problem clearly.
    They will definitely give some solution.
    Please reward points if helpful.
    Thanks
    Sivaparavthi

  • Local Outlook in virtual environment crash when we add long path attachment

    We have MS Office 2007 install localy on our Windows 2008 R2 server with App-V SP3 client. We have configured Outlook to start in the Acrobat Reader XI virtual environment for the pdf file preview. When we try to add a long path attachment in Outlook,
    Outlook crash.
    If we run Outlook outside the Reader virtual environment, Outlook does not crash. If i try to make a procmon to find a solution, Outlook freeze but does not crash and procmon does not return interresting information. I have try to start Outlook in another
    virtual environment, it still crash.
    We have made some more testing. We have discovered that Outlook crash on file path longer than 242 character. Normally, the max path in Windows is 260 character. Thats why we does not  understand why we have this bug.
    Any idea someone to solved this problem?

    The path of the file we try to add to the mail is something like this : 
    G:\Urbanisme\Volet Réglementation\Certificats de conformité\Conformité - Environnement_MDDELCC (LQE)\2015\LQEnv_Carré Belvédère-Gestion Élias_milieux humides_2015-02-27.gaegra\LQenv_projet de développement _ Carré Belvédère_2015-03-23_marjac.docx
    I am not sure about the Q drive you talk about... I know than in App-V 4, there was Q drive, but we use App-V 5 SP3 (i forgot to tell in my original post).
    Thanks for your help Rorymon!

  • Web Service 2.0 add Activity with attachment

    I have a requirement, use Java code to add an activity with attachment using the wsdl of web service 2.0.
    However, I can't add attachment successfully.
    without any attachment, the activity can be added successfully in CRMOD.
    my soap msg without attachment is like "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn:crmondemand/ws/ecbs/activity/10/2004\" xmlns:data=\"urn:/crmondemand/xml/Activity/Data\"><soapenv:Header /><soapenv:Body><ns:ActivityInsert_Input><data:ListOfActivity><data:Activity><data:ServiceRequestNumber>85-3143833</data:ServiceRequestNumber><data:Description>at-test18</data:Description><data:Subject>AT18</data:Subject><data:Activity>Task</data:Activity></data:Activity></data:ListOfActivity></ns:ActivityInsert_Input></soapenv:Body></soapenv:Envelope>";
    in this case,I can found the new activity AT18 added in CRMOD.
    But, if I add attachment in my soap msg, such as
    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn:crmondemand/ws/ecbs/activity/10/2004\" xmlns:data=\"urn:/crmondemand/xml/Activity/Data\"><soapenv:Header /><soapenv:Body><ns:ActivityInsert_Input><data:ListOfActivity><data:Activity><data:ServiceRequestNumber>85-3143833</data:ServiceRequestNumber><data:Description>at-test18</data:Description><data:Subject>AT18</data:Subject><data:Activity>Task</data:Activity><data:ListOfAttachment><data:Attachment><data:DisplayFileName>attachment.txt</data:DisplayFileName><data:FileNameOrURL>attachment</data:FileNameOrURL><data:FileExtension>txt</data:FileExtension><data:Description>Attachment Desc</data:Description><data:Attachment>dGVzdCBhdHRhY2htZW50</data:Attachment></data:Attachment></data:ListOfAttachment></data:Activity></data:ListOfActivity></ns:ActivityInsert_Input></soapenv:Body></soapenv:Envelope>";
    then I will get the error
    Update operation on integration component 'Activity' failed because no matching record in business component 'Action' with search specification '[Description] = "AT18"' could be found.(SBL-EAI-04403)
    I am not sure whats the reason....in the API document. It mentions for web service 2.0 'the Insert method can be used to insert both parent records and child records', and 'ActivityInsert' above is actually call the insert method, How I can insert both ativity and attachment successfully? Does anybody have some suggestions?
    Thanks in advance!
    Kane
    Edited by: user13108801 on 18-May-2010 20:05

    Thanks Dinesh,
    I am in Release 17, in R17, the InsertChild is not supported, API only support 'insert' for both parent and child.
    It looks the 'insert' operation with child record actually do the 'update' operation for the parent record to update its child node.
    if I send msg using insert operation like:
    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn:crmondemand/ws/ecbs/activity/10/2004\" xmlns:data=\"urn:/crmondemand/xml/Activity/Data\"><soapenv:Header /><soapenv:Body><ns:ActivityInsert_Input><data:ListOfActivity><data:Activity><data:ServiceRequestNumber>85-3143833</data:ServiceRequestNumber><data:Description>at-test18</data:Description><data:Subject>AT18</data:Subject><data:Activity>Task</data:Activity><data:ListOfAttachment><data:Attachment><data:DisplayFileName>attachment.txt</data:DisplayFileName><data:FileNameOrURL>attachment</data:FileNameOrURL><data:FileExtension>txt</data:FileExtension><data:Description>Attachment Desc</data:Description><data:Attachment>dGVzdCBhdHRhY2htZW50</data:Attachment></data:Attachment></data:ListOfAttachment></data:Activity></data:ListOfActivity></ns:ActivityInsert_Input></soapenv:Body></soapenv:Envelope>";
    it will failed with the error msg I mentioned before.
    however, if I create the parent node first:
    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn:crmondemand/ws/ecbs/activity/10/2004\" xmlns:data=\"urn:/crmondemand/xml/Activity/Data\"><soapenv:Header /><soapenv:Body><ns:ActivityInsert_Input><data:ListOfActivity><data:Activity><data:ServiceRequestNumber>85-3143833</data:ServiceRequestNumber><data:Description>at-test18</data:Description><data:Subject>AT18</data:Subject><data:Activity>Task</data:Activity></data:Activity></data:ListOfActivity></ns:ActivityInsert_Input></soapenv:Body></soapenv:Envelope>";
    and then still use insert operation to add the activity with a attachment:
    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn:crmondemand/ws/ecbs/activity/10/2004\" xmlns:data=\"urn:/crmondemand/xml/Activity/Data\"><soapenv:Header /><soapenv:Body><ns:ActivityInsert_Input><data:ListOfActivity><data:Activity><data:ServiceRequestNumber>85-3143833</data:ServiceRequestNumber><data:Description>at-test18</data:Description><data:Subject>AT18</data:Subject><data:Activity>Task</data:Activity><data:ListOfAttachment><data:Attachment><data:DisplayFileName>attachment.txt</data:DisplayFileName><data:FileNameOrURL>attachment</data:FileNameOrURL><data:FileExtension>txt</data:FileExtension><data:Description>Attachment Desc</data:Description><data:Attachment>dGVzdCBhdHRhY2htZW50</data:Attachment></data:Attachment></data:ListOfAttachment></data:Activity></data:ListOfActivity></ns:ActivityInsert_Input></soapenv:Body></soapenv:Envelope>";
    then, the attachment will be added successfully.
    And I searched API document of Release 17, it mention that 'The Insert method can be used to insert both parent records and child records. If a child node is specified in the request, the Insert method inserts the child and associates it with the existing parent record. If a child node is missing, the Insert call inserts only the new parent record.'
    So, is it that we can say the Insert method for child node can success only if the parent node is already existed? seems we can not insert both parent and child at one time.
    Thanks
    Kane

Maybe you are looking for

  • Issue with richtables after file download

    Hello. Please help me solve the next problem. I have two tables (master-detail) on my page and a commandButton with af:fileDownloadActionListener assigned to it. After filtering tables i press commandButton and download Excel file with the content fr

  • Urgent: Calling ABAP Program using JMS

    Hi, I have a scenario where legacy system pass some messages to ABAP Program and this program can handle one message at a time (written in that way). Now the receiver communication channel is configured to access J2SE adapter. This J2SE adapter store

  • I cannot get the Amazon kindle to connect to my Cisco Wireless network

    I'm running the 1142 APs with version 6.x on the WLC 4400. I have no security at the moment. Any ideas why it won't connect? thanks Gary

  • TM Backup Volume after restoring with Migration Assistant

    Hi there, I recently restored my system from a time machine volume via migration assistant (NOT while first boot, because it hangs on caluculating amount of space there) to be able to use Boot Camp (my partition seemed to be too much fragmented). The

  • Printing a Word document from Memory Card?

    My C4250 is in a different room from my Win XP PC. If I copy & paste a Word document to a memory card, can I print the document without connecting the PC to the printer? If I can, how do I do it?  Thank you for your reply/help