Hi Nick, cfmail works a bit like a cfoutput tag with email functionality.
you can cfmail query = "yourquery" + rest of params just like you do with a cfoutput. within the cfmail tags use cfloops if you need to, but to insert fields just do it exactly as you would withing cfoutput tags. eg. <cfmail query ="yourquery" [... rest of params]> Dear #yourquery.firstname#, </cfmail> Hope this helps Jenny ----- Original Message ----- From: "Nick Sweeney" <[EMAIL PROTECTED]> To: "CF-Newbie" <[email protected]> Sent: Tuesday, October 25, 2005 3:29 PM Subject: CFMail Functionality > Howdy All! > I have written a handy tool to email newsletters to my clients or my > client's, clients - whomever I have in my database orgainized by group. > (Think SPAM, but with membership) You can save the Email "message" in the > database and then choose which group to send the message to. Pretty basic, > but the message can be anything... HTML, pictures, text - whatever. > > I want the "Message" to be customizable - and to be able to personalize > the email. "Dear John Smith" (Or customizable with any info I have in the > DB) I tried writing CF tags in the Mail message to write our the > personalization... but that doesn't work. Could it work?? Is it > possible??? Code as follows: > > Saved Message: > "Dear <cfoutput>#qryGetEmail.FirstName# #qryGetEmail.LastName#</cfoutput>, > > With your support and the support of blah blah... Presumably message is > wrapped in HTML and graphics to make it sexy!" > > Sending Code: > <cfif IsDefined("FORM.SendCamp") AND FORM.SendCamp EQ "Sent"> > > <CFMAIL > query="qryGetEmailSubs" > type="html" > SUBJECT="#qryGetEmailCamps.ECTitle#" > FROM="[EMAIL PROTECTED]" > TO="#qryGetEmailSubs.Email#"> > > #qryGetEmail.EMMessage# <!--- The saved Message---> > <br> > <hr> > <br> > <font face="Arial, Helvetica, sans-serif" size="-2"> > © #year(NOW())# #qryGetClient.Name# - All rights reserved.<br> > #qryGetClient.Address1#, #qryGetClient.City#, #qryGetClient.State# > #qryGetClient.Zip# > <br><br> > <a href="#qryGetClient.WebAddress#" > class="footer">#qryGetClient.WebAddress#</a><br> > <br> > > This email was sent to #qryGetEmailSubs.Email#.<br> > If you feel you have received this email by mistake or would like to be > removed from our mailing list, please contact us at <a > href="mailto:#qryGetClient.Email#" > class="footer">#qryGetClient.Email#</a>. > </font> > </CFMAIL> > > <!--- Now update the sent date ---> > <cfset Sent = "#Now()#"> > <cfquery datasource="#datasource#" username="#username#" > password="#password#"> > Update EmailCampaign Set DateSent = #Sent# > WHERE ECID = #qryGetEmailCamps.ECID# > </cfquery> > > </cfif> > > Thanks as always everyvbody! > > -Nick > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1486 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
