ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 22nd, 2004, 06:30 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Content ID & Images in HTML email

I'm doing the following :

Code:
<cfset logoCID = randRange(1000, 10000) & '@' & randRange(1000, 10000) />

<cfset htmlBody = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

<img src=CID:#logoCID#>
<h3>HTML Mail Message</h3>
<p>This message is <strong>HTML</strong>.</p>

</body>
</html>' />

<cfset textBody = 'Some text' />


<cfmail subject="Email Test" type="multipart/related">
    <cfmailpart type="text" wraptext="72">
        #textBody#
    </cfmailpart>
    <cfmailpart type="html">
			<cfmailparam file="e:\inetpub\testarea\webroot\htmlConfirmation\logo.gif" type="image/gif" disposition="attachment" contentID="#logoCID#" />
				#htmlBody#
    </cfmailpart>
</cfmail>


When I get the test email the Image (I'm just looking at outlook right now) isn't there...

I know these options have just recently been added to <cfmailparam> but they should work, any ideas why its not?

-D

Reply With Quote
  #2  
Old September 23rd, 2004, 04:16 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Someone must have some experience with this... any ideas?

Reply With Quote
  #3  
Old September 23rd, 2004, 08:08 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,626 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 6 m 34 sec
Reputation Power: 53
I believe you need the image to be a valid URL that points to an image, just as you would on any web page. I haven't ever tried to embed an image into the email and am not sure how you'd go about that.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old September 23rd, 2004, 09:26 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
I have it figured out now, so I'm sharing it incase others find this thread :

Code:
<cfset logoCID = createUUID() />

<cfmail ... type="html">
	<cfmailpart type="text/html">
		<h1>Test</h1>
		<img src=cid:#logoCID# /> 
	</cfmailpart>
	<cfmailpart type="text/plain">
		Some plain text
	</cfmailpart>
	<cfmailparam file="image.gif" contentid="#logoCID#" disposition="attachment" />
</cfmail>


I think the key parts to mention are the type of the root <CFMAIL> function & the types of the <CFMAILPART>s

Finally I found out that (outlook at least) doesn't like it when the cid in the source is in uppercase.

-D

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Content ID & Images in HTML email


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway