Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 235 Big Data Appliance
- 1.9K Data Science
- 449.8K Databases
- 221.6K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 477 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.9K SQL & PL/SQL
- 21.3K SQL Developer
- 295.4K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.1K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 158 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 395 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 230 Portuguese
Email campaign image issue

Hey,
I have built an email campaign which allows the client to send emails giving their new username and login.
Everything is working well except, when I add an image to display at the bottom of the email (company logo) it doesn't grab said image, I added the image in the HTML getting the image which is saved on the static application files.
I have tried numerous ways which include adding the image to the static workplace files, using the image URL, changing the HTML code but all seem to have the same outcome, no image displayed.
I would attach screenshots but I have tried so many different ways.
Comments
-
There are 3 basic ways to add an image to HTML e-mail.
Via an URL to the image on a web server. This will be blocked by default by most e-mail readers, and needs to be explicitly allowed by the user for the mail reader to access it.
By base64 encoding of the image into the SRC attribute of the IMG element. E.g.
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2 wCEAAkGBxITEBMUEhAVFRIWFRYWGBUVGSQeFRkhIBIWHBciFh8kICgsHyAxIBYX ...">
Or attaching the image to the e-mail, and pointing the SRC attribute of the IMG element to the attachment's content identifier. E.g.
<img src="cid:attachment-content-id">
-
@Billy Verreynne here's my HTML code, I haven't yet tried the base 64 encoding yet, just unsure how to store it as I presume it would need to be shortened. (This is using the email templates)
<b>Dear #CUSTOMER#,</b><br>
<br>
You have been granted access to ESA Risk's Debtabase.</b><br>
<br>
<table width="100%">
<tr>
<th align="left">Username</th>
<td>#USERNAME#</td>
</tr>
<tr>
<th align="left">Password</th>
<td>#PASSWORD#</td>
</tr>
<br>
<th align="left" valign="top">Please login at https.//app.debtabase.com, where you will be prompted to change your password.</th>
</br>
<tr>
<th align="left" valign="top">Kind regards,</th>
</tr>
<tr>
<th align="left" valign="top">Debtabase Administration Team</th>
</tr>
<tr>
</table>
<br>
<img src="#APP_IMAGES#ESA-RISK.jpg" width="100" height="100"/>
</br>
-
Unsure whether doing an inline encode of an image (especially one more than 12KB) is a good idea. Worth a try if smaller.
I prefer attaching the image to the e-mail and using a content-id reference to the attachment. I have however my own custom MIIME parser for creating the raw e-mail headers and body. Have not tried APEX e-mail interface and templates.
PS. sending full user credentials (name and password together), and including the logon URL, via unsecure medium like e-mail is a serious security risk
-
<img src="#APP_IMAGES#ESA-RISK.jpg" width="100" height="100"/>
Application images cannot be used outside an APEX session, so your email cannot retrieve the image. Store your image somewhere on a web server.
I wouldn't go the base64 route. A lot of mail clients cannot handle base64 embedded images. I found this article:
CID works, but not with APEX_MAIL. You will need to write your own mail procedure. I have a very old feature request for that:
-
Application images cannot be used outside an APEX session, so your email cannot retrieve the image.
@InoL , I think that isn't true at least on APEX 20.x and later. Or I do I miss something
-
I never realized that, but you are right, This is a static image in my application on apex.oracle.com:
So, for the OP: this is not enough:
<img src="#APP_IMAGES#ESA-RISK.jpg" width="100" height="100"/>
You need the complete path, not the relative path.