PDA

View Full Version : Send to Mulitple emails using CFM form


WebPlaya
07-30-2004, 08:41 PM
Hello, let me show you the code and then I'll ask the question so you can understand it better. :)

<cfmail to="myemail@email.com" from="#form.name#" subject="Overtime Request" cc="#form.sup#" type="HTML">


Basically, I want to send this email to myemail@email.com, #form.sup# (which is the email address that will come from the drop down menu on the form) and also want it to be send to few more email addresses.

can i do...

<cfmail to="myemail@email.com; youremail@email.com; theiremail@email.com" from="#form.name#" subject="Overtime Request" cc="#form.sup#" type="HTML">


Thank you so much for your help and time.

P.S. I did search the forum but did not find anything and wasn't sure how to do it in CFM. :)

Roy Sinclair
07-30-2004, 10:03 PM
That format should work, give it a try.

WebPlaya
07-31-2004, 12:11 AM
Yeah, I have a feeling that it should work as well. But it's a live form and I can't test it.

I'll see if I can save it as a back up and try it from there but if anyone knows for sure, please do reply to this post and cofirm it.

Thanks again.

mindlessLemming
07-31-2004, 01:52 AM
This'll work:

<cfquery name="getEmails" datasource="myDSN">
SELECT email_addr
FROM myTable
</cfquery>

<cfmail
to="#valueList(getEmails.email_addr)#"
from="webmaster@yourdomain.com"
subject="Nigerian Business Proposition"
>


#valueList()# gives you a comma delimited list of values retrieved for a specific column in a query.

WebPlaya
08-06-2004, 05:44 PM
I put the ; sign and it worked just fine.. thanks guy.. :)