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:
  #1  
Old August 14th, 2008, 11:08 AM
jennypretty jennypretty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 11 jennypretty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 47 sec
Reputation Power: 0
How to add HTML code to format in CFMAIL

Hello,
I am a newbie to CFMAIL and like to ask if there is a way to format the output within CFMAIL. I tried to enter HTML code within CFMAIL and I got the html code from output.

I created a simple comments form for users to submit their comments, and send this result to my email.

Here is my code:

<CFMAIL TO = "test@test.com"
FROM = "test@test.com"
SUBJECT = "test"
>

New suggestions: <br />
<b>Name:</b> #name#
<b>Comments:</b> #comments#
</CFMAIL>

On the output, I received all html code and when a user enter multiple rows of suggestions, they are not aligned properly in the email.

How do I format the output within cfmail?
How do I get good format for the comments with multiple rows?

Thanks very much.

Jenny.

Reply With Quote
  #2  
Old August 14th, 2008, 02:05 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,260 kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 2 Weeks 5 h 28 m 25 sec
Reputation Power: 896
Just use type="html". You can check the docs for full details.

Reply With Quote
  #3  
Old August 18th, 2008, 01:45 PM
Master__Chief Master__Chief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 244 Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 22 h 16 m 45 sec
Reputation Power: 33
<CFMAIL TO = "test@test.com"
FROM = "test@test.com"
SUBJECT = "test"
type="html"
>

Reply With Quote
  #4  
Old August 21st, 2008, 12:44 PM
mateojaime mateojaime is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 3 mateojaime User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 17 sec
Reputation Power: 0
RE: adding HTML to CFMAIL

one thing to think about when sending HTML code via CFMAIL is that you will need to use inline styling rather than referencing a CSS file reason being is MS Outlook alot of times does not like CSS files especially if your email gets forwarded, hence your HTML layout can get messed up so to use inline styling with your HTML is a good standard to use that way if your HTML email gets forwarded it looks consistent.

EX:
<table border="0" cellpadding="0" cellspacing="0" style="width:100%; font-family:Arial, Helvetica, sans-serif;">
<tr>
<td></td>
</tr>
</table>

Reply With Quote
  #5  
Old August 23rd, 2008, 08:15 PM
mackindlays mackindlays is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 11 mackindlays User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 6 sec
Reputation Power: 0
If this is for business use and not a spam bot.. be sure to override the default CF mail header...

<cfsilent>
<cfmailparam name="X-MimeOLE" value="Produced By Microsoft Exchange V6.5.7226.0">
<cfmailparam name="X-MS-Has-Attach" value="yes">
<cfmailparam name="X-MS-TNEF-Correlator" value="">
<cfmailparam name="Content-class" value="urn">
<cfmailparam name="content-classes" value="message">
<!---- if you have attachments add them in too---->
<cfif len(arguments.messagebean.getAttachment_1())>
<cfmailparam file="#attachment_local_file_1#">
</cfif>

</cfsilent>

Many mail services bounce CF generated mail's now.
good luck

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > How to add HTML code to format in CFMAIL


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




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT