This forum is currently locked. You can't register or post questions at this time. (read more)

Unable to send the email with embedded image using PLSQL

All posts relating to Oracle PL/SQL development.

Moderator: Tim...

Sus
Member
Posts: 3
Joined: Mon Sep 02, 2013 7:26 am

Unable to send the email with embedded image using PLSQL

Postby Sus » Mon Sep 02, 2013 7:59 am

Hello Tim

I have a user request to send out an email with embedded APEX chart in the email body. Your following posts are really helpful.

(1) http://www.oracle-base.com/articles/mis ... -plsql.php
(2) http://www.oracle-base.com/articles/mis ... -plsql.php

I am now able to generate an HTML file (with embedded image) and also send an email from Oracle.
However, I am still having a problem - cannot view the image ( but a small x icon) in the email body, although the image is perfected shown on the generated HTML file.


I am using Oracle 11g r2 and Outlook to get an email. How to fix the issue here ?

Thanks for your advice.
Sus

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Unable to send the email with embedded image using PLSQL

Postby Tim... » Mon Sep 02, 2013 8:32 am

Hi.

If the HTML is displaying OK, before you send it as an email, I can only assume one of two things:

1) The process of sending the email is screwing it up.
2) The email client is not able to handle the embedded images.

Have you tried viewing the email in a number of different email clients?

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

Sus
Member
Posts: 3
Joined: Mon Sep 02, 2013 7:26 am

Re: Unable to send the email with embedded image using PLSQL

Postby Sus » Fri Sep 06, 2013 2:29 am

Hi Tim

This is a very frustrating issue. I have tried to use Content-ID approach, but no luck.

In Outlook2010, the email's source looks like this

In Outlook, the source looks like this

'<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head>

<body background="cid:test.png@01CBB95B.9A1FD110">
.rest of mail
</body>
</html>'


I am able to print out the HTML, its source looks like this:
MIME-Version: 1.0 To: myvalidemailaddress From: myvalidemailaddress Subject: Test Message Reply-To:myvalidemailaddress

Content-Type: multipart/alternative; boundary="a1b2c3d4e3f2g1" --a1b2c3d4e3f2g1

content-type: text/plain; charset=us-ascii This is a test message. --a1b2c3d4e3f2g1

Content-type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable

..rest of mail iVBORw0KGgoAAAANSUhEUgAAA7QAAAEdCAYAAAA8SyuhAABDQElEQVR42u2deXBU .......

Below is the code I used for emailing, can you see anything wrong ?
Regards
Sus
Last edited by Sus on Mon Sep 09, 2013 12:57 am, edited 1 time in total.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Unable to send the email with embedded image using PLSQL

Postby Tim... » Fri Sep 06, 2013 7:35 am

Hi.

Be realistic. I'm not going to be able to spot anything in your code.

The approach I would take to solve this is as follows.

1) Write out the HTML to a file, before you put it into an email. Check the HTML is valid by opening it in a browser and maybe using a HTML validator. If this is working fine, you know it is not the problem.

2) Send the email with the embedded HTML, but all images with SRC to external images hosted on a website. If this is working, you know the basic HTML email is working correctly. Since there are no embedded images, this can't be the problem.

3) Send the full HTML email including the embedded images. Now open this using a range of mail clients, including Outlook, Thunderbird, Gmail etc. This will check if it is just a bug in a specific mail client.

The only way to identify and solve the problem is to work through it meticulously.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

Sus
Member
Posts: 3
Joined: Mon Sep 02, 2013 7:26 am

Re: Unable to send the email with embedded image using PLSQL

Postby Sus » Mon Sep 09, 2013 2:26 am

Ok, Tim.

I have already done Point 1 before raising the issue, which was working fine. But not sure how to do Point 2. Will work that out. Thanks.

Sus

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Unable to send the email with embedded image using PLSQL

Postby Tim... » Mon Sep 09, 2013 7:51 am

:)
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle SQL and PL/SQL Development”

Who is online

Users browsing this forum: No registered users and 0 guests

cron