Couldn't see that anyone replied to this......
It really depends if you want the email COPIED to the other people - or you
just want each of the other people to be sent a separate email.
What you have done in the loop will send separate emails to each of the
people in the list.
The other way to do it would be to just put the FORM.emailAddress into the
"to" field of the <CFMAIL> tag. �It supports multiple email addresses with
commas (like most email systems do).
Of course, you can drop the FORM.emailAddress into either the CC or BCC
fields as well.
Just a couple of points to note about the code:
1. The email address form you are using is the "Name <email address>"
form. �You can just put in email addresses when you dont know the Name
portion - but drop the <>.
2. In the loop you are using the "var" function around your index
variable. �There is no need to do this.
3. To be "compliant" with XML style syntax you should always enclose
attribute values in quotes (<cfmail to="#i#"....>)
4. Trivial - but you may like to remove the spaces around either sides of
the email addresses (there is no need for the space - but it will be
ignored by the mail system)
Gary Menzel
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828 �FX: �07 3834 0828
[EMAIL PROTECTED] wrote on 01/17/2003 02:29:47 PM:
> Hey all,
>
> When usiong CFMAIL, how can i send to multiple recipients other than
those
> allowed in the CFMAIL tag scope using a form with say 3-5 e-mail
textboxes
> for the user to type in?? Can I have say 3-5 textfields with same name
and
> loop over those fields to determine who gets the email on form submit??
>
> I've got the below and all works fine (when i know who i'm sending to):
>
> <cfmail to= [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> � � � cc=" [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> "
> � � � bcc= [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> � � � from=" [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> "
> � � � subject="multi e-mails test"
> � � � type="HTML">
>
> � � **html shite here**
>
> </cfmail>
>
> can I have:
>
> <cfloop list="#trim(FORM.emailAddress)#" index="i">
>
> <cfmail to=#val(i)#
> � � � from=" [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> "
> � � � subject="multi e-mails test"
> � � � type="HTML">
>
> � � **html shite here**
>
> </cfmail>
> </cfloop>
>
> what if they don't choose to send onto any other peoples
>
> matt
>
>
> **********************************************************************"
> This correspondence is for the named person's use only. It may
> contain confidential or legally privileged information or both. "
> No confidentiality or privilege is waived or lost by any "
> mistransmission. �If you receive this correspondence in error, please
> immediately delete it from your system and notify the sender. �You
> must not disclose, copy or rely on any part of this correspondence
> if you are not the intended recipient.
>
> Any views expressed in this message are those of the individual sender,
> except where the sender expressly, and with authority, states them to
> be the views of Vodafone.
>
> This email has been checked for viruses.
> **********************************************************************
>
>
> ---
> You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/