Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Open outlook and attach blobs as file attachments?

Phil GJan 5 2017 — edited Jan 6 2017

Hello guys,

i have managed to open outlook on a link using javascript:window.location.href = 'mailto:test@test.com?subject=subject&body=bodytext';

I am wondering if there is a way to attach blobs from the db as files into this solution?

Any advice appreciated.

Comments

Sunil Bhatia

This question is not at all related to APEX and its functionalities. Please ask the question in jQuery or javascript forum. Still for your help, please refer to below:

jquery - Is it possible attach a file to an Email in JavaScript? - Stack Overflow

Also this might help you

https://blogs.msdn.microsoft.com/rajnishkaushik/2007/05/06/compose-and-send-e-mail-from-javascript-by-using-outlook-automation-2007/

Regards,

Sunil Bhatia

Phil G

Thank you Sunil Bhatia. I would have thought the only place the incorporates apex, javascript and plsql and the db all in one place is indeed the Apex forum.  I'll read the links you have provided. The links I have read so far do seem to concentrate on using attachments from files and not blobs.

Regards

Phil

Pavel_p

Hi Phil,

I believe you're not invoking necessarily Outlook, it can be any default mail client. I would suggest to use rather Outlook REST API https://msdn.microsoft.com/en-us/office/office365/api/use-outlook-rest-api (if you're going to deal with the Exchange server).

Regards,

Pavel

MortenBraten

Hi,

In addition to the newer REST API that Pavel linked to (for which you'd have to write your own wrapper code around), you could also look into this utility package to work with an Exchange server from PL/SQL using the older SOAP based API:

ORA-00001: Unique constraint violated: MS Exchange API for PL/SQL

- Morten

Phil G

Awesome reading stuff guys thank you. Yes I am able to deal with a possible solution from the backend DB (hosted on linux). I wold easily be able to get the standard smtp routing in place. I am currently in proof of concept and I am more worried the my client will ask for a browser client side approach rather than a backend approach.

Scott Wesley

Client side as in email client?

Because you could make an APEX page that handles the components of email (to, subject, content, blobs) and use apex_mail or Morten's exchange API to send the email.

Phil G

Client side as in the browser opening the email client which at present is outlook and this will be on their windows clients as opposed to apex_mail which will make use of smtp on the linux database server. Morton has suggested a pl/sql wrapper for MS exchange. Again this appears to be backend unless I have missunderstood it. I have no problems with backend solutions if the technical architects will approve this approach. What I need to investigate is the user opening outlook from the browser and the blobs, selected by the user are are automatically attached as files in the windows outlook client.  If its impossible then then at least I know and can work with the TA on a backend only solution.

It would appear so far the only approach I can see is that I would have to download the blobs first to the filesystem (windows) and use the javascript create email using files as attachments option.

Phil.

1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 3 2017
Added on Jan 5 2017
7 comments
2,221 views