How do I attach an image kept in an Oracle BLOB column to the mail without changing the format of the image (and without having to use a File object)?
1 posts in topic
Flat View  Flat View

Posted On:   Wednesday, June 11, 2003 05:30 PM

How do I attach an image which is kept in Oracle Database as BLOB into a mail message and send by invoking Java classes from SQL procedures (in Oracle)?

I have tried this but my image was sent as character stream(as an hexadecimal data) not as an attachment of the mail body such as a GIF or TIFF file.

Re: How do I attach an image

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, June 12, 2003 09:05 AM

I think you have to use multipart/related overall, e.g. so the main body part can refer to/link to the image (attachment) part, if you expect to display the image inline in the body. And you have to set the content-type of the part containing the image content, to the appropriate string e.g. "image/gif", "image/jpeg", etc... And of course a message containing any binary data is supposed to be encoded for transit e.g. Content-Transfer-Encoding:base64, to protect it in transit, since only 7-bit ascii is guaranteed to make it unmolested through SMTP. But then it gets decoded by the mail client application that receives it.

About | Sitemap | Contact