UTL_SMTP - send attachments

Hello

I have a requirement to send files on the Linux server for some users. The files are the result of a SQL loader work (.log file and.) BAD files).

I have a simple script which generates an email:

DECLARE

mailhost VARCHAR2 (64): = 'fake.net;

sender VARCHAR2 (64): = ' [email protected] ';

beneficiary VARCHAR2 (64): = ' [email protected] ';

mail_conn utl_smtp.connection;

BEGIN

mail_conn: = utl_smtp.open_connection (mailhost, 25);

UTL_SMTP. HELO (mail_conn, mailhost);

UTL_SMTP.mail (mail_conn, sender);

UTL_SMTP. RCPT (recipient, mail_conn);

UTL_SMTP.open_data (mail_conn);

UTL_SMTP.write_data (mail_conn, 'Test' | chr (13));

UTL_SMTP.write_data (mail_conn, 'Soft Test': chr (13));

UTL_SMTP.close_data (mail_conn);

UTL_SMTP. Quit (mail_conn);

END;

/

How attachments can be incorporated in the above script.

The files are located in the server/db/home/files/sqlloader directory.

file - load for example names. BAD and load.log

Both files must be attached in the email. can anyone suggest how can this be achieved?

Thank you

Waste code.

Use DBMS_LOB. ReadFromFile() to read the file a LOB - text in a CLOB and binary (for example the png image) to a BLOB.

You will need to encode base64 BLOB and store the results in a CLOB.

UTL_MAIL is a piece of junk - you will discover when setting more than 32 KB of data, or have multiple attachments. And the reason for this becomes clear when you look at the source code to see that programming was so pathetic, that GoTo statements have been used.

You will need to use UTL_SMTP to a sending correct e-mail with attachments.

If attachments are not used in the body of the e-mail, mail MIME type can be text/plain or text/html, followed by the attachment MIME parts.

If attachments are used in the body of the email (for example as the source of an IMG element in HTML email), then the MIME type must be multipart/mixed. The body of the email must be a collection of text/html and image/png images (or other) attachments. Bindings of the image also needs to have an identifier contained in their headers, and HTML in the body attachment elements must refer to them using the cid:.

Illustrated by Peter, it is best to write an interface package to do all this--and then simply use and reuse the interface to send mails.

Tags: Database

Similar Questions

  • When you use hotmail, I can't join or send attachments. This has happened after recently update of Firefox.

    Hello. I've recently updated my Firefox on my Mac and I can no longer add or send attachments on my hotmail email account. When I compose a new message or press on answer, the bar/button fastening is visible, but it does not respond when the mouse is over it. When I try to send an email with an attachment, the transfer email is displayed but the attachment is not present. I can, however, open attachments are sent to me.

    I was able to fix before emails without problem, but have not been able to do since the upgrade of my Firefox browser. I followed a few older instructions that said to erase the recent cookies and cache, but that does not solve the problem.

    Any suggestions? Thank you!

    Solution!
    I had read that I needed Silverlight installed to run those (and apparently it was already installed)... but after not seeing it helps any, I disabled it on my Mozilla Add - ons... and NOW I can add attachments!

    Mac OS x 10.6.4
    FireFox 3.6.14

  • Cannot send attachments with Hotmail

    My Hotmail allow me to send attachments more - the option is grayed out - I can't even send others sent me attachments. There is none of the problems listed (virus, too). He used to work for years, and then to the subject a month ago, it is stopped.  How can I fix it?

    Hello

    The question you have posted is related to windows live and will be well suited in the Windows live forum. Click on the link below.

    Windows Live Solution Center

    http://www.windowslivehelp.com/

  • How can I add more capacity to my email? I tried to send attachments, and they are not sent, says that it's too big

    I need to be able to send attachments, for my work.  I need to increase the capacity for the things sent.  How can I do this?

    Tuesday, June 12, 2012 18:44:53 + 0000, Debbie DF says:

    I need to be able to send attachments, for my work.  I need to increase the capacity for the things sent.  How can I do this?

    How great the message you can send is depends on your ISP. They put
    the limit, no Windows, and not your e-mail program.

    Ask them what the limit is, and whether you can change it. But be
    aware that it is likely that you can not have the raised limit.

    Ken Blake, Microsoft MVP

  • Unable to send attachments in outlook express. HTML is selected and is therefore 'send pictures' recipient receives the text but not images?

    I am unable to send attachments in outlook express. HTML is selected and is therefore 'send pictures' recipient receives the text but not images?

    All security settings seem fine, an idea?

    Some messages do not conform to the standards of the Internet in the sense that they cannot be returned intact by their transmission.  The way around this is to use Message | Until the attachment, then they will be properly transmitted, since they will be attached.

    Steve

  • I can not send attachments to the e-mail (msn, hotmail) and was told to reinstall silverlight, but I can't uninstall it, and I could not install the last update.

    Silverlight only updated [failed] and I cannot uninstall

    I can not send attachments to the e-mail (msn, hotmail) and was told to reinstall silverlight, but I can't uninstall it, and I could not install the last update. Any suggestions

    Please repost your request in the Forum Microsoft Silverlight.  Thank you! Carey Frisch

  • You want to send attachments without using skydrive in my hotmail account.

    Original title:

    I don't want skydrive

    How to send attachments without them going via skydrive. I just want to send in the form of normal Word or excel documents parts attached as I always did before Skydrive appeared automatically in my hotmail account. I totally agree with all other reviews posted - you shouldn't do without the prior consent of the user.

    Hello
     
    I suggest you to post the same question in the Windows Live Solution Center, Windows Live has a dedicated team to help you with questions of Hotmail.
    Hotmail Portal: http://windowslivehelp.com/product.aspx?productid=1
     
    I hope that aid of information!

  • How to send attachments / photos from my laptop with my emails

    How to send attachments to send pictures of my web cam

    It would be easier to answer your question if we knew that the email that you use.  Each of the different works.  Procedures for gmail mentioned above do not work for many other e-mail programs that use icons instead of "attach a file" to the function (or "attach a file" is buried under another layer of menu items).

    If it's Outlook, click on the paperclip and which will bring up a dialog box to find and attach the file you want (you must be in the email compose window when you do this and the file that you want to join must be registered on the system - but not necessarily as an attachment - just saved).  When you select the file and click OK this file will be attached to the e-mail that you dial.  It basically works the same way with Windows Mail and Windows Live Mail.

    I hope this helps and if you want clarification, please identify the e-mail (name and version) client.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • What happens in Windows Mail? I can not send attachments with any type of graph.

    Unreal

    What happens in Windows Mail? I can not send attachments with any type of graph. People receiving my email with attachments receive between 60 and 70 copies. I called my provider, my safety, send the computer for a week for a Tech and no one can answer this problem for me. If I don't get this problem resolved I will never use Microsofts again e-mail programs.

    Tools | Accounts | Mail | Properties | Advanced. Uncheck the box: "Break apart messages...". ».
    If this isn't the cause, try to compact and repair the database.
     
     
     
  • cannot send attachments, saying that there is a problem with the pop

    Microsoft and hotmail work together? cannot send attachments or email through microsoft

    Hello

    The question you posted would be better suited to Windows Live Solution Center. I suggest you to send your application in the Windows Live Solution Center for better support.

    http://windowslivehelp.com/product.aspx?ProductID=10

    http://windowslivehelp.com/

    Hope this helps,

  • I can not send attachments to the e-mail message no error code either

    I can not send attachments in hotmail

    I can not send attachments in hotmail

    Hey fredpomona

    they will help you in the hotmail link below forums

    http://www.windowslivehelp.com/product.aspx?ProductID=1

    Walter, the time zone traveller

  • After I send attachments, the recipient cannot open the document

    original title: documents

    Hi, am having problems after I send attachments, the recipient cannot open the document?

    That helps me, but not the recipient. We can only look at a Word, (file .doc) document, if they have the word or Word Viewer installed.

    There are many people who don't use MS Word, but almost everyone has a PDF reader. This tool allows to convert the resume in PDF and who should make it readable to the person you send him. I can't imagine a company that accepts mail resumes would not have a PDF such as Foxit or installed Adobe Reader.

    Online Doc To PDF Converter
    http://www.Doc2PDF.NET/

    Bruce Hagen
    MS - MVP October 1, 2004 ~ September 30, 2010
    Imperial Beach, CA

  • Cannot send attachments, files, photos

    HP G72 notebook PC

    Windows 7

    Unable to send attachments, files, photos.  When I hit send, I hear a 'bling '.

    Office 2010 is installed.  I get a message that my use of the trial is in place, then I enter the key # new?

    Hello

    Looks like you are using Outlook. Unfortunately, you will have to pay for it before you can continue to use the product. Please try this:

    http://Office.Microsoft.com/en-us/buy/using-the-product-key-card-FX101853163.aspx

    Kind regards.

    PS I posted last year, that's what I really hate.

  • I'm unable to send attachments using outlook - windows7

    could someone provide a fix because I'm unable to send attachments using outlook - windows 7

    Thanks Phil

    Hi Phil,

    Are you referring to Microsoft Office Outlook or Outlook.com?

    You receive an error message when you try to sebd attachments?

    If you are referring to Outlook.com you can follow the steps suggested by Shikha_G dated 6 March 2013 , the following responses from Microsoft link:

    http://answers.Microsoft.com/en-us/windowslive/Forum/mail-email/thread-1-im-not-able-to-work-with-attachments-in/1b2d932d-C507-4a2e-b8cd-649389b46fb8

    Warning: him reset Internet Explorer settings feature might reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings.

    If you are referring to Microsoft Office Outlook, please post question you on the following forum link:

    http://answers.Microsoft.com/en-us/Office/Forum?tab=QnA

    I hope this helps.

  • Why can't send attachments

    My attachments icon disappeared from my email when I brought to compose an email and I can't find it so I can't send attachments from an hour ago. I could send them before but how to get my icon back please?

    No, sorry, it seems that many others have the same problem but no response from microsft

    Very strange because yesterday I gave as a result of my problem and gave this explanation and it worked.  You should check further

    Click your email again

    then insert

    Choose inline or join

    Access the ISB/doc and he

    Right-click on the image and adjust the size

    This is a new feature of Outlook and it works

Maybe you are looking for