Need Help for ColdFusion mail sending

pranjalsharda used Ask the Experts™
I need help for sending mail in coldfusion along with embeded images in mail

Can some one help

I am unable to get this info from anywhere

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Build the string with all html tag. so put the image in the <img src="test.gif">

let ur string like

<cfset str= "">
<cfset str = str & "<html><head><title>test</title></head>">

<cfset str = str & "<body><img src=""<path>"">

cfmail to="<to email id>" from="<from email id>"
               subject="<subject>" type="HTML">



let me know.



Thanks Dash,

But this will not send the mails with embedded image

I need to send mail with embedding


Hi pranjalsharda,

Do you mean attached to the mail (an attachment) or just embedded in html like dash suggested?

Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Hi pranjalsharda,

it is not possible to send image in the mail body. you can do it if u send the mail with attachment file. and file containing the image.  


Hi All,
I had tried a code I got from google search somebody had posted it Here is the code

<cfmail to="" from="" subject="test image">
<cfmailparam name="mime-version" value="1.0">
<cfmailparam name="content-type" value='multipart/alternative; boundary="------------7C252360672B03A0BAD013A5"'>
--------------7C252360672B03A0BAD013A5 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This is the text version. Blah... --------------7C252360672B03A0BAD013A5 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

<html><body> This is the HTML version.
<IMG src="cid:003a01c11b56$c06b9d20$">
 --------------7C252360672B03A0BAD013A5 Content-Type: image/gif; name="myimage.gif" Content-Transfer-Encoding: base64 Content-ID: <003a01c11b56$c06b9d20$>
<cffile action="read" file="#expandpath('myimage.gif')#" variable="charData">
<cfset data64 = toBase64(charData)>#data64# --------------7C252360672B03A0BAD013A5-- -- End --


This code tries to embed the image as inline image but all that I get in mail is garbage (Probably bcos MIME Type setting is changed)

your image src must be a full path. (e.g <img src="">). only then u will not need to attach the image to the email. The code u showed is a multipart mail. It sends both plain txt and html mail together. Depending on what the software the user is using, if it can read html, it takes the html portion, else it takes the plain txt portion.
Top Expert 2013

This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care

Top Expert 2013

It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

points to elhy


If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.


Closed as per recommendation

Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial