Skip to main content

Posts

Showing posts with the label email

Inline Attachments for Oracle APEX Emails

Prior to APEX 21.2, when you add any attachments to APEX email using apex_mail.add_attachment procedure, then those attachments are always added with  Content-Disposition as attachment . This behavior can be verified when we view the received emails as plain text, For e.g. refer to the below screenshot of an email taken using the "Show Original" option in the Gmail web client. APEX 21.2 has introduced a new feature that enables us to send attachments as inline attachments. There is a new parameter p_content_id added to apex_mail.add_attachment procedure. We can specify content_id for attachments and we can use this content_id to refer to the image in cid: scheme in img tags of HTML emails. In one of my previous blogposts, Including Images in Oracle APEX Emails , I have discussed a few options using which we can include images in emails. One of the options is attaching images to an email and referring to attached images by file name in cid: scheme. This works in deskt...

Including Images in Oracle APEX Emails

 In this blogpost, I am going to explain different ways using which we can include images as part of the email content. CID Attachments In this approach images are sent as attachment to the email and then images are referred in email content using attached filename. For e.g. if you want to include image "ironman.jpg", then you need to attach this image file to the email. Then you can refer the attached image using below syntax in "img" tag "src" attribute. <img src= "cid:ironman.jpg" alt= "ironman" /> Sample PL/SQL code to use this approach DECLARE l_body CLOB ; l_body_html CLOB ; l_img_html CLOB ; l_id NUMBER ; BEGIN -- build html email body l_body_html := '<!DOCTYPE HTML>' || '<html>' || '<head>' || '<meta http-equiv="Content-Type" content="text/html; charset=...