How about amending your query to only return results that have an email
address?

-----Original Message-----
From: cfcom [mailto:[email protected]] 
Sent: Monday, January 05, 2009 3:01 PM
To: cf-talk
Subject: RE: Personalizing a CFLoop - validation error


I added four columns to database; 'recip_firstname, recip_lastname,
recip_title, recip_email'. Now all the 'sender and recipient' data in the
same table of db, but I keep getting an error:

//Attribute validation error for tag CFMAIL.
//The value of the attribute TO is invalid. The length of the string, 0
//character(s), must be greater than or equal to 1 character(s).



<cfinsert datasource="mynamedsn" tablename="mytablename"
                  formfields="sender_firstname, sender_lastname,
sender_email, sender_address, sender_city, sender_state, sender_zip,
sender_time, sender_date, sender_ip, sender_msgType">


<CFQUERY NAME="GetRecipients" 
                 datasource="mynamedsn" >
                 SELECT * FROM mytablename 
</CFQUERY>

        <cfloop query="GetRecipients">

        <cfmail to="#GetRecipients.recip_email#"  from="#form.sender_email#"
subject="My Message To You 2009"  >
      #sender_date#
        
        
       Dear #GetRecipients.recip_title# #GetRecipients.recip_firstname#
#GetRecipients.recip_lastname# 
        

      This is my message to the recipient.  This is my message to the
recipient.  This is my message to the recipient.  This is my message to the
recipient.  This is my message to the recipient.  This is my message to the
recipient.  This is my message to the recipient.  This is my message to the
recipient.  
                

      Yours truly,
          
      #form.sender_firstname# #form.sender_lastname#
      #form.sender_address#
      #form.sender_city#, #form.sender_state# #form.sender_zip#
      #form.sender_email#
        </cfmail>
</cfloop>



-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: 2009-01-05 3:17 PM
To: cf-talk
Subject: RE: Personalizing a CFLoop

I would just do something like this then.

<CFQUERY NAME="GetRecipients" DATASOURCE="#DataSource#">
SELECT * FROM Recipients
</CFQUERY>

        <cfloop query="GetRecipients">

        <cfmail to="#GetRecipients.Email#" from="#sender_email#" subject="My
Message To You 2009"  >

      #sender_date#
        
        
      Dear #GetRecipients.Name#
        

      This is my message to the recipient.  This is my message to the
recipient.  This is my message to the recipient.  This is my message to the
recipient.  This is my message to the recipient.  This is my message to the
recipient.  This is my message to the recipient.  This is my message to the
recipient.  
                

      Yours truly,
          
      #sender_firstname# #sender_lastname#
      #sender_address#
      #sender_city#, #sender_state# #sender_zip#
      #sender_email#
        </cfmail>
</cfloop>




-----Original Message-----
From: cfcom [mailto:[email protected]] 
Sent: Monday, January 05, 2009 2:21 PM
To: cf-talk
Subject: RE: Personalizing a CFLoop

Yes, it is stored. I can store form_sender and recipients if necessary

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: 2009-01-05 2:13 PM
To: cf-talk
Subject: RE: Personalizing a CFLoop

Is the recipient data stored in a table by chance?








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317419
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to