Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to attach BLOB to email using pure PLSQL solution

Re: How to attach BLOB to email using pure PLSQL solution

From: Gary Menchen <gary.e.menchen_at_dartmouth.edu>
Date: Tue, 30 Mar 2004 07:57:41 -0500
Message-ID: <c4bqu2$1ep$1@merrimack.Dartmouth.EDU>


bsc7080mqc_at_mylxhqdotcom.com wrote:
> I have tried a myriad of things with no luck.... small files fine..
> anything over 32k..nothing. I have been using the
> UTL_ENCODE.ENCODE_BASE64 command but little or no luck. Any ideas ?
>
>

You might post the text (with all headers etc) of a very small example. I use utl_tcp to send binary attachements, and it's worked well for several years.

You need to establish a unique string to serve as a boundary for the attachment(s). In the example below I use '---SECBOUND' Output the following after the message itself is completed

  ---SECBOUND
  Content-Type: text/plain;
  name="' ||[name of file]||'"
  Content-Transfer-Encoding: base64'
  Content-Disposition: attachment;ATTACHMENT   filename="[name of file]"
   [a blank line]
   (Output the base64-encoded contents of the file. I use lines    of 76 characters, but that is arbitrary. Remember that if you are    not encoding the entire file all at once, base64 works in groups of 3    characters.)
  ---SECBOUND
   [a blank line]

And because I'm using utl_tcp I follow this with a line with a period, and a QUIT. Received on Tue Mar 30 2004 - 06:57:41 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US