How to remove the newline character at the start in the attachment ?

Hi All,
I have been trying to attach a .dat file generated at an external source and send it as an attachment by mail using UTL_SMTP, all things are working but the .dat file which comes attached in mail contains a newline character i.e. chr(10) at the start line and the contents of the file are written from second line onwards. Below is some part of the code which deals with read/write of attachment of mail to be sent.
Can anyone help me on this, is something to be changed in this code??
UTL_SMTP.write_data(c,
'Subject' || ': ' || P_SUBJECT || UTL_TCP.crlf);
UTL_SMTP.write_data(c,
'MIME-Version: 1.0' || UTL_TCP.crlf || -- Use MIME mail standard
'Content-Type: multipart/mixed;' || UTL_TCP.crlf ||
' boundary="-----SECBOUND"' || UTL_TCP.crlf ||
UTL_TCP.crlf);
UTL_SMTP.write_data(c,
'-------SECBOUND' || UTL_TCP.crlf ||
'Content-Type: text/plain;' || UTL_TCP.crlf ||
'Content-Transfer_Encoding: 7bit' || UTL_TCP.crlf ||
UTL_TCP.crlf);
UTL_SMTP.write_data(c, UTL_TCP.crlf || l_text);
UTL_SMTP.write_data(c, UTL_TCP.crlf);
UTL_SMTP.write_data(c, UTL_TCP.crlf);
UTL_SMTP.write_data(c,
'-------SECBOUND' || UTL_TCP.crlf ||
'Content-Type: text/plain;' || UTL_TCP.crlf ||
' name="/inetpub/wwwroot/Novation_Merge/FS_Extract.dat"' ||
UTL_TCP.crlf ||
'Content-Transfer_Encoding: 8bit' || UTL_TCP.crlf ||
'Content-Disposition: attachment;' ||UTL_TCP.crlf || ' filename="' || p_description ||
TO_CHAR(SYSDATE, 'DD-MON-YYYY') || '.dat"' ||
UTL_TCP.crlf || UTL_TCP.crlf ||UTL_TCP.crlf);
BEGIN
l_filehandle := UTL_FILE.fopen('c:\temp',
'FS_Extract.dat',
'r',
32767);
LOOP
UTL_FILE.GET_LINE(l_filehandle, l_buffer, 32767);
UTL_SMTP.write_data(c, l_buffer || UTL_TCP.crlf);
END LOOP;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
UTL_FILE.fclose(l_filehandle);
UTL_SMTP.write_data(c, '-------SECBOUND--');
UTL_SMTP.close_data(c);
UTL_SMTP.quit(c);
EXCEPTION
WHEN UTL_SMTP.transient_error OR UTL_SMTP.permanent_error THEN
BEGIN
UTL_SMTP.quit(c);
EXCEPTION
WHEN UTL_SMTP.transient_error OR UTL_SMTP.permanent_error THEN
NULL;
-- When the SMTP server is down or unavailable, we don't have
-- a connection to the server. The quit call will raise an
-- exception that we can ignore.
END;
RAISE_APPLICATION_ERROR(-20000,
'Failed to send mail due to the following error: ' ||
SQLERRM);
END;
Thanks,
-Amol

As I recall, a single blank line serves as separator between Mime Header and Mime Body.
This code..
UTL_SMTP.write_data(c,
  '-------SECBOUND' || UTL_TCP.crlf ||
  'Content-Type: text/plain;' || UTL_TCP.crlf ||
  ' name="/inetpub/wwwroot/Novation_Merge/FS_Extract.dat"' ||
  UTL_TCP.crlf ||
  'Content-Transfer_Encoding: 8bit' || UTL_TCP.crlf ||
  'Content-Disposition: attachment;' ||UTL_TCP.crlf || ' filename="' || p_description ||
  TO_CHAR(SYSDATE, 'DD-MON-YYYY') || '.dat"' ||
  UTL_TCP.crlf || UTL_TCP.crlf ||UTL_TCP.crlf);  ..generates 2 blank lines after the Mime Header.
Remove the last CRLF and see if that does the trick.

Similar Messages

  • How to remove a newline character from a column

    hi all...
    i have a column in a table in which some of the datas contain a newline character at their last.
    i need to remove those newline characters.
    for example.... a data is
    'abcd
    (notice the end of the quotation).....i need to get the data as...'abcd'
    plss help me...
    thanks in advance..

    thanks for ur reply...
    i got your point..but here what you have done is....u have inserted a particular character set in between 'abcd' and 'xyz' and afetr that just replaced those character set by null....
    but in my case the problem is a bit different...
    the datas are already present and what i have to do is to remove the newline spaces from the end of the datas.
    select replace(column_name,'<what shall i put here>',null) from table_name;
    in your example...that is 'chr(10)'...but in my case its a newline character....

  • I have 0,3€ credits. How can remove them so that I can change to the app store of another country?

    I have 0,3€ credits. How can remove them so that I can change to the app store of another country? I need to change to the Chinese app store as the apps I am looking for can be only found there. Thanks for all answer in advance!

    Click here and ask the iTunes Store staff to zero your account balance. Note that if you're not in China, you won't be able to use the Chinese App Store.
    (125951)

  • How to remove bullets and spacing for url links in the Related Links iview?

    I tried to look for a property that I can edit the look-n-feel of the url links in the Related Link iView using "Theme Editor".
    All I need is to remove the bullets and increase some vertical spacing between the links.
    Currently, it looks like this:
    URL iView A
    URL Iview B
    I go through the whole section of Related Links properties, none of them seems to do what I want.
    Here are the list of properties in Related Link section (of Navigation Panel):
    Link Color
    Text Decoration of Link
    Hover Color
    Text Decoration of Hovered Link
    Initially, I thought "Text Decoration of Link" should be the right property I should look at. But there are a drop-down with 5 options: None, Underline, Blinking, Overline and Line-Through, which really can't achieve what I want.
    Thanks for advice.
    Kent
    Post with Diagram Illustration:
    <a href="http://sapnetweaverforum.blogspot.com/2006/11/how-to-remove-bullets-and-spacing-for.html">How to remove bullets and spacing for url links in the Related Links iview?</a>
    Message was edited by: Kent C.

    Hi, Kai.
    I checked the Related iView properties (URL Template), I don't see what layoutset it is really using. I am not sure, is that a layout set apply to the Related Link Iview?
    For the regular KM iView, I will see what Layout Set I want to apply, then I can go and change the properties (of layout coontroller, collection renderer & resource renderer)you mentioned. But for this Related Link iView, I really don't know. I guess it may be in the code itself.
    If there is a layout set for Related Link iView (or the place to apply layout set to it), can you point to me which one is that? (I did a search through the layout set names, I only find the AppQuicklinkExplorer (I used this for Dynamic Nav. Link iView before), if I can aply this layout set to Related Link iView, my problem will be solved.)
    Thanks for help.
    Kent

  • How to remove save, cancel option when end user runs the workbook in Portal

    Hi,
    how to remove save, cancel option when end user runs the workbook and make some small changes like using page items or increasing rows and columns
    I already made 2 changes
    1) I removed the option in Oracle Enterprise Manager under discoverer viewer of saving
    2) I also removed the option of Allow saving changes made in Viewer when adding workbook to portal
    But still the end user gets options of saving when made small changes to workbook like increasing rows and columns
    Is their any place, I need to make changes?
    Thanks in Advance
    Rowdheer

    Don't use JSP to serve a binary file. It almost implies the use of awful scriptlets and the invocation of both the response writer and the response outputstream which would only lead to IllegalStateException headaches in the server logs.
    Use a Servlet instead. Specify the file name as request parameter and let the servlet read the file and write it to the outputstream of the response.

  • I am a beginner of "pages" and have this problem of dots while writing the text. I dont know how to remove these bullets-like dots while spacing in the text. Please help

    I am a beginner of "pages" and have this problem of dots while writing the text. I dont know how to remove these bullets-like dots while spacing in the text. Please help

    Look up "formatting" in the User Guide.
    http://manuals.info.apple.com/MANUALS/0/MA524/en_US/Pages_UserGuide.pdf

  • I'm selling my early 2011 MBP because I just bought a iMac. Could someone please tell me how to remove all my information from it but leave the OS working. Thanks so much.

    I'm selling my early 2011 MBP because I just bought a iMac. Could someone please tell me how to remove all my information from it but leave the OS working. Thanks so much.

    How do I securely delete data from the machine?
    Erase, formatting, OS X installs on Mac's

  • Remove last newline character

    How can I remove the newline character only from the very end
    of a string? (Note there are several newline characters within the
    string). Thanks!

    How long is the string and roughly how many newline
    characters are there? One way, although kinda funky, would be to
    convert the newline-delimited list to an array, and then convert it
    back. See below.

  • How to remove new line character from query output?

    Hi,
    How to remove new line character from query output?
    have tried select replace(column_name, CHR(10), ' ') from table_name.
    Edited by: GreenHorn on Sep 11, 2008 12:53 AM

    Please consider, that windows uses a sequence of chr13||chr(10) Unix uses only one character chr(10).
    The new line character(s) may be OS-dependent.
    You could consider both with:
    replace(replace(column_name, CHR(13)||CHR(10), ' '),CHR(10),' ')
    Hartmut
    Edited by: hartmutm on 11.09.2008 01:32

  • I have a free app on my iphone, i would like to get it to my ipad..how do I get it without having to start over the entire game?

    I have a free app on my iphone, i would like to get it to my ipad..how do I get it without having to start over the entire game?

    If you use the same Apple ID on both devices, you can share apps, but you won't share the progress I'm afraid.

  • To import all songs on the CD, click Yes in the window that appears. iTunes starts importing the CD.---I am using a Dell and can't import the CD I need because the window doesn't automatically pop up.  How do I fix this?  Any thoughts?

    "To import all songs on the CD, click Yes in the window that appears. iTunes starts importing the CD."
    I am using a Dell and can't import the CD I need because the window doesn't automatically pop up. How do I fix this? Any thoughts?

    You could try my script ConvertFormat and see if you like the results. Would be easier than inserting the CDs and correcting the tag info again. Just be aware this is a one-way trip. Once you've thrown away some quality to shrink the files you can't get it back without going back to the source. You may better off investing in a bigger drive.
    If you just want to squeeze more on the iPod you can use the built-in iTunes option to convert files to a lower bitrate as they are added to the device.
    tt2

  • Appears and quickly disappears a new screen overlaying the screen in use, it starts at the bottom of the screen tela.MACbook pro retina.O what could be causing this?

    appears and quickly disappears a new screen overlaying the screen in use, it starts at the bottom of the screen tela.MACbook pro retina.O what could be causing this?

    Thanks for the suggestion, the next step was to call Apple, who gave me a claim number, which I discovered you must have to get anything done with them.  They refered me to a Apple store or repair center, after some reseach took it to the Computer Store in Mobile, Alabama and they were excellent.  They took pictures of the screen with bug submitted it to Apple who denied the claim but they kept kicking it up to the next level and finally Apple agreed to sent new cover.  The Computer Store had the cover the next day, they changed it out and now I am bug free.  If your in the area of Mobile Alabama you can feel good about getting help from the Computer Store.  For the two folks that responded to my note, Thank You, good comments and good advice.

  • Hey ppl,my macbook is not booting and by that i mean u can hear the audio wave when its starting up,the screen goes white and then after a while there's a folder with a question mark in the middle of the screen...anyone,any ideea?!?

    Hey ppl,my macbook is not booting and by that i mean u can hear the audio wave when its starting up,the screen goes white and then after a while there's a folder with a question mark in the middle of the screen...anyone,any ideea?!?Regards.

    That folder with the question mark icon means that the MacBook can't find the boot directory. That can either mean it can't find the hard drive or the hard drive data is somehow corrupted.
    Put your install DVD into the drive and reboot. As soon as you hear the boot chime, hold down the "c" key on your keyboard (or the Option key until the Install Disk shows up). That will force your MacBook to boot from the optical drive.
    Once it has finished booting and you are at the Install screen launch Disk Utility from the Utilities menu. Is your Hard Drive in the list on the left?
    If it is then select the First Aid Tab run Repair Disk and if that repairs any problems run it again until the green OK appears and then run Repair Permissions.
    If your hard drive isn’t recognized in Disk Utility then your hard drive is probably dead.

  • Can we change the label of Java Web start at the time of downloading applic

    can we change the label of Java Web start at the time of downloading application?
    At the time of downloading application(jar files) java web start shows "Downloading Application" lable on it window , so can we change it so some other..

    The 'splash' screen might be of interest to you.
    Here is the quick description from the FAQ.
    <http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html#206>
    Section 3.5 of the JNLP Spec. has more details on using a splash screen for an application.
    (But if you mean changing the very first screen seen when downloading an application the first time, the answer is 'no'.)
    Late addendum..
    By the way - now I review your question, I note you stress 'while jars are downloading'.
    There is another strategy you might take. Mark most of the application jar's as 'lazy' download, get the main GUI on-screen quickly, then use the JNLP API's DownloadService to fetch the rest of the jars, after the application is running.
    This has the advantage that, then we can have complete control of whatever is shown on the screen during the bulk of the downloads. We might show ..a 'splash screen', or a dialog with the application name on it, or a progress dialog, ..or any combination of the three.
    Edited by: AndrewThompson64 on Oct 22, 2007 3:01 PM

  • The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.

    I am just starting the JDEV and trying to start the weblogic server and then I get the following message.
    The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.
    Can anybody help me to resolve this issue.

    932013 wrote:
    I am just starting the JDEV and trying to start the weblogic server and then I get the following message.
    The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.
    Can anybody help me to resolve this issue.
    Try the WebLogic forum:  WebLogic Server - General

  • The Server Instance cannot be started because the Integrated Weblogic domai

    I am newbie to Jdeveloper .When i try to run my jsp file it gives me this error....
    The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.
    and the log file shows..
    Log File: C:\Users\Jignesh\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\o.j2ee.adrs\CreateDefaultDomain.log
    Label: JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    Product Home: C:\Oracle\Middleware\jdeveloper\jdev\
    Domain: C:\Users\Jignesh\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain
    "C:\Oracle\Middleware\oracle_common\common\bin\wlst.cmd" "C:\Users\Jignesh\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\o.j2ee.adrs\CreateDefaultDomain.py"
    Process started
    wlst > The system cannot find the path specified.
    Elapsed time: 293 ms

    Before you delete the full system directory you try deleting just this one:
    C:\Users\Jignesh\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain
    and restart JDev
    If this doesn't help then delete the C:\Users\Jignesh\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\ and restart

Maybe you are looking for

  • Premier Pro CS6, Classroom in a Book....Lesson Files, Help Please.

    Hello everyone, new guy on the block here and having problems. I recently purchased Premier Pro CS6 software and the accompanying book mentioned in my posts title above. I am trying to work through the book and the associated projects but keep coming

  • Refresh parent without clearing cache

    Hi: Does a parent window reload clear the cache of the parent window as well? I have a custom lov. The pop0up wworks fine. The only way I seem to be able to assign the value back to the parent and have it display is to refresh the parent window from

  • 3external midi white in track

    Hello, I think that I set up the external midi correctly. But when I goto record, the track is white. I have pressed the mute button and it turns grey. I can hear the piano in my audio interface input 1. I have the piano set up in the environment and

  • MIGO field selection - vendor batch number

    I created a new movement type by copying from the standard SAP movement type 501 (GR w/o purchase order). When posting a GR with this movement type and a batch-managed material, the Batch field is open for entry but the Vendor Batch field (GOITEM-LIC

  • Setting captivate files at initial app launch to branch to different slides

    I'm using a menu to run a training session that contains multiple swf files. They need to run individually or in serial. I want each module to know if it needs to go back to the menu it came from (individually) or to the next training module (serial)