freelanceprogrammers.org Forum Index » Cold Fusion
<cfif> in <cfmail>
Joined: 20 Jan 2004
Posts: 3
<cfif> in <cfmail>
I want to use <cfif> in <cfmail>.
<CFMAIL
SUBJECT= "* Project (#prjName#) Assign Notification *"
FROM="IntranetAdmin@..."
TO="#TheEmail#@... <cfif GetEmail1.recordcount gt 0>;
#TheEmail1#@...</cfif><cfif GetEmail2.recordcount gt 0>;
#TheEmail2#@...</cfif><cfif GetEmail3.recordcount gt 0>;
#TheEmail3#@...</cfif>"
Type ="HTML" >
Attribute validation error for tag CFMAIL.
The value of the attribute to, which is currently "DKang@... ,
HTyler@..., @swgeneral.com, @swgeneral.com", is invalid.
It seems that <cfif> is ignored in <cfmail>. Please advise how to get
around this problem.
Thank you,
Daniel
Joined: 02 Apr 2005
Posts: 20
<cfif> in <cfmail>
There may be another way to accomplish what you are trying to do. What exactly are you trying to do? Have you stored email addresses as just "myname" instead of myname@...? If so, there may be other ways to insert the domain name.
The way we used to do it (and still do...) back in the days of Cold Fusion 4.5 (<rant>you know, when Cold Fusion was an Allaire product, not a Macromedia product...when the java controls actually worked because they were able to pass underscores in variables regardless of JRE or JVM version...when you only had to install CF server once to get it working...</rant>) was to loop the mail tag. Seemed to have a lot less mail server weirdness that way, but takes some extra processor cycles to do it.
<cfloop query="mailquery">
<cfmail
to="#mailquery.email#"
from=billg@...
subject="Hope this works"
type="html">
Stuff to email
</cfmail</cfloop>
Not sure if that is what you are trying to accomplish. Forgive me for sounding like Captain Obvious if I am way off here! LOL!
Mark Gregory
----- Original Message -----
From: Kang, Daniel
To: `cold_fusion@yahoogroups.com`
Sent: Monday, January 19, 2004 8:06 PM
Subject: [cold_fusion] <cfif> in <cfmail>
I want to use <cfif> in <cfmail>. <CFMAIL SUBJECT= "* Project (#prjName#) Assign Notification *" FROM="IntranetAdmin@..." TO="#TheEmail#@... <cfif GetEmail1.recordcount gt 0>;#TheEmail1#@...</cfif><cfif GetEmail2.recordcount gt 0>;#TheEmail2#@...</cfif><cfif GetEmail3.recordcount gt 0>;#TheEmail3#@...</cfif>"Type ="HTML" >Attribute validation error for tag CFMAIL. The value of the attribute to, which is currently "DKang@... ,HTyler@..., @swgeneral.com, @swgeneral.com", is invalid. It seems that <cfif> is ignored in <cfmail>. Please advise how to getaround this problem.Thank you,Daniel
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/cold_fusion/ To unsubscribe from this group, send an email to:cold_fusion-unsubscribe@yahoogroups.com Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Joined: 20 Jan 2004
Posts: 3
<cfif> in <cfmail>
I can do it as below. <cfinclude template="prjAsgEmailNotification.cfm">
is for the <cfmail> piece.
<cfquery name="GetEmail1" datasource="PWDNCA">
select *
from PWDNonClinical
where AssociateID = `#form.prjmemberID1#`
</cfquery>
<cfif GetEmail1.recordcount eq 0>
<cfelse>
<cfset TheEmail = GetEmail1.Email>
<cfinclude template="prjAsgEmailNotification.cfm">
</cfif>
<cfquery name="GetEmail2" datasource="PWDNCA">
select *
from PWDNonClinical
where AssociateID = `#form.prjmemberID2#`
</cfquery>
<cfif GetEmail2.recordcount eq 0>
<cfelse>
<cfset TheEmail = GetEmail2.Email>
<cfinclude template="prjAsgEmailNotification.cfm">
</cfif>
<cfquery name="GetEmail3" datasource="PWDNCA">
select *
from PWDNonClinical
where AssociateID = `#form.prjmemberID3#`
</cfquery>
<cfif GetEmail3.recordcount eq 0>
<cfelse>
<cfset TheEmail = GetEmail3.Email>
<cfinclude template="prjAsgEmailNotification.cfm">
</cfif>
However, the problem is that the person (who will be cc`d) will receive
several identical e-mails.
That is the reason I am trying to do:
TO="#TheEmail#@... <cfif GetEmail1.recordcount gt 0>;
#TheEmail1#@...</cfif><cfif GetEmail2.recordcount gt 0>;
#TheEmail2#@...</cfif><cfif GetEmail3.recordcount gt 0>;
#TheEmail3#@...</cfif>"
so that the cc`d person will get only one e-mail.
Please advise.
Thank you,
Daniel
-----Original Message-----
From: Yahooooo! [mailto:yahoodude@...]
Sent: Monday, January 19, 2004 11:24 PM
To: cold_fusion@yahoogroups.com
Subject: Re: [cold_fusion] <cfif> in <cfmail>
There may be another way to accomplish what you are trying to do. What
exactly are you trying to do? Have you stored email addresses as just
"myname" instead of myname@...? If so, there may be other ways to
insert the domain name.
The way we used to do it (and still do...) back in the days of Cold Fusion
4.5 (<rant>you know, when Cold Fusion was an Allaire product, not a
Macromedia product...when the java controls actually worked because they
were able to pass underscores in variables regardless of JRE or JVM
version...when you only had to install CF server once to get it
working...</rant>) was to loop the mail tag. Seemed to have a lot less mail
server weirdness that way, but takes some extra processor cycles to do it.
<cfloop query="mailquery">
<cfmail
to="#mailquery.email#"
from=billg@...
subject="Hope this works"
type="html">
Stuff to email
</cfmail
</cfloop>
Not sure if that is what you are trying to accomplish. Forgive me for
sounding like Captain Obvious if I am way off here! LOL!
Mark Gregory
----- Original Message -----
From: Kang, Daniel
To: `cold_fusion@yahoogroups.com`
Sent: Monday, January 19, 2004 8:06 PM
Subject: [cold_fusion] <cfif> in <cfmail>
I want to use <cfif> in <cfmail>.
<CFMAIL
SUBJECT= "* Project (#prjName#) Assign Notification *"
FROM="IntranetAdmin@..."
TO="#TheEmail#@... <cfif GetEmail1.recordcount gt 0>;
#TheEmail1#@...</cfif><cfif GetEmail2.recordcount gt 0>;
#TheEmail2#@...</cfif><cfif GetEmail3.recordcount gt 0>;
#TheEmail3#@...</cfif>"
Type ="HTML" >
Attribute validation error for tag CFMAIL.
The value of the attribute to, which is currently "DKang@... ,
HTyler@..., @swgeneral.com, @swgeneral.com", is invalid.
It seems that <cfif> is ignored in <cfmail>. Please advise how to get
around this problem.
Thank you,
Daniel
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/cold_fusion/
To unsubscribe from this group, send an email to:
cold_fusion-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/cold_fusion/
To unsubscribe from this group, send an email to:
cold_fusion-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Joined: 20 Jan 2004
Posts: 2
<cfif> in <cfmail>
Instead of trying to do it in the CFmail tag, do it before, witha
variable. Maybe something like this....
<cfscript>
suffix = "@swgeneral.com";
to = TheEmail & suffix;
if(GetEmail1.recordcount gt 0) {to = to & TheEmail1 & suffix;}
if(GetEmail2.recordcount gt 0) {to = to & TheEmail2 & suffix;}
if(GetEmail3.recordcount gt 0) {to = to & TheEmail3 & suffix;}
</cfscript>
<CFMAIL
SUBJECT= "* Project (#prjName#) Assign Notification *"
FROM="IntranetAdmin@..."
TO="#to#"
Type ="HTML" >
__________/ Kang, Daniel \__________
>I want to use <cfif> in <cfmail>.
Joined: 20 Jan 2004
Posts: 2
<cfif> in <cfmail>
you can`t. At least not in CF 4.5.
I heard something about that kind of thing being possible in MX, though.
__________/ Kang, Daniel \__________
>I want to use <cfif> in <cfmail>.
Joined: 20 Jan 2004
Posts: 3
<cfif> in <cfmail>
Thank you so much for your help.
Daniel
-----Original Message-----
From: Jolly Green Giant
To: cold_fusion@yahoogroups.com
Sent: 1/20/2004 10:53 AM
Subject: Re: [cold_fusion] <cfif> in <cfmail>
Instead of trying to do it in the CFmail tag, do it before, witha
variable. Maybe something like this....
<cfscript>
suffix = "@swgeneral.com";
to = TheEmail & suffix;
if(GetEmail1.recordcount gt 0) {to = to & TheEmail1 & suffix;}
if(GetEmail2.recordcount gt 0) {to = to & TheEmail2 & suffix;}
if(GetEmail3.recordcount gt 0) {to = to & TheEmail3 & suffix;}
</cfscript>
<CFMAIL
SUBJECT= "* Project (#prjName#) Assign Notification *"
FROM="IntranetAdmin@..."
TO="#to#"
Type ="HTML" >
__________/ Kang, Daniel \__________
>I want to use <cfif> in <cfmail>.
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/cold_fusion/
To unsubscribe from this group, send an email to:
cold_fusion-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Joined: 26 Aug 2005
Posts: 2
<cfif> in <cfmail>
Anyone here use the linkpoint api?
I have a few questions and would like to take them off line. Please respond
directly to me.
Thanks, bill
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







