Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending email to individuals from a query

Status
Not open for further replies.

dreampolice

Technical User
Dec 20, 2006
85
US
I need to send an individual email to about 100 names fetched from an Access 2003 database. I am fetching the distinct emails from the database and getting each Project owned by each distinct email address.

I created the correct output on a test web page where the query will list every distinct email address with each email address having their own Project Title listing. Now the question is how do I use my output to send an individual email to each of the distinct email addresses I got in my query??
For example someone with the email Address of johnson@company.com would get one email with his Project Title listings that could be 3 or 4 titles. The next distinct email address of smith@company.com will get his own email with his Project title listings.

Here is my attempt but the #userEmail# has everyones email address.
Code:
<cfoutput query = "theQuery" group = "userEmail">
<cfmail to: #userEmail# subject: Project Listing
<cfoutput>Project Listing:  #ProjectTitle#</cfoutput>
<cfmail>
</cfoutput>
Please help.
 
Query:

Code:
select distinct userEmail, max(id), ProjectTitle from tableUser
 
what you posted above is riddled with syntax errors so its obviously not your actual code. please submit you actual code.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
What TruthInSatire is trying to say is, please post your actual query so we can help debug the issue. Also, show us what the resultset looks like. As in when the query returns a result what does it look like? (THAT part can be fictional).

____________________________________
Just Imagine.
 
That's not what i was trying to say. That's what i did say.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Thanks for your replies.

It now works like this where I used cfmail group to work like cfoutput group:

Code:
<cfmail 
to = #userEmail# 
from = here.com 
query = "theQuery" 
group = "userEmail">
<cfoutput>Project Listing:  #ProjectTitle#</cfoutput>
<cfmail>
 
We need to see what the query looks like. Please post the actual query. Also, show us what the result-set looks like. As in when the query returns a result what does it look like? (THAT part can be fictional).

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top