EasyCFM.COM ColdFusion Forums / Other / email function

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: email function

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

emma_ratm
06-14-2006 @ 10:51 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 9
Joined: May 2006

hello everyone...i'm back again with new topic to be discussed...

first, i have a table that consists of the column "Database" and "Email". each "Database" has a unique "Email".

the "Database" field is filled by a user of the website, then, an alert email will be sent to the respective email regarding the "Database" name.

my codes go like this:

---the "FORM.Database" are sent when the user hit the submit button and will be sent to this page:----

<cfparam name="FORM.Database" default="1">
<cfquery name="Recordset1" datasource="user_app">
SELECT Email
FROM Database
WHERE Database = '#FORM.Database#'</cfquery>

-----i've tried to call "#Email#" at the "cfmail to" but the message wasn't delivered.-----
<cfmail
<cfoutput query="Recordset1"> to="#Email#" </cfoutput>
        from="emma_ratm@perdana.um.edu.my"
        subject="New Application Request for Database"
type="html">
<p>.....</p></cfmail>


is it ok if i put the cfoutput tag in the cfmail tag; just like i did above?

thank you for giving attention to my problem here.. thanks again.

maquiladoras
06-14-2006 @ 11:04 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2073
Joined: Dec 2002

anytime you have a <CFwhatever> tag, you do not need to specify an output as all ##'s will be rendered

so simply

<cfmail to="#recordset1.Email#" ....>

even if it did take cfoutput, what would happen is if you had 12 emails for the same domain, it would render like

<cfmail to="myemail1@mysite.com" to="myemail2@mysite.com" .... to="myemail12@mysite.com">


however, anything between <cfmail></cfmail> needs to be wrapped in a <cfoutput> else it won't get rendered

-
Any code printed thus far is likely to be stolen and used by Ray Horn, well done...ray
-


Website Designed and Developed by Pablo Varando.