CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 building a csv string for email as bcc list for emailing

Print topic Send  topic

Author Message
aewhite901

Posts: 36
Posted: 01/22/2005, 6:13 AM

Hi folks,
I need to construct a single string as follwos

me@here.there.com,more@some.com, and so on...

I have been iterating thorugh the database but cannot seem to
construct the string. Each email address is returned correctly.
The idea is to use the "Undisclosed Recipeints" method of emailing
to minimize the imapct on my email server.
Can someone suggest how I might build this strings please?

thanks
Tony White
View profile  Send private message
Martin K.
Posted: 01/23/2005, 2:07 AM

Hello.

You can make the string like this code:

global $NewGrid1;
// New db Connection
$db = new clsDBConnection1(); // Your connection
$Max_Mail = 1000;
$ShownMail = 0;
$SQL = "SELECT email FROM users WHERE 1"; // Your SQL Statement
$db->query($SQL);
$Result = $db->next_record();
if($Result && $ShownMail < $Max_Mail)
{
do {
$the_mail[] = $db->f("email");
$ShownMail++;
$is_next_record = $db->next_record();
} while ($is_next_record && $ShownMail < $Max_Mail);
}

else // Show NoRecords are found
{
echo "NoRecords are found";
}
#############################################################################
// Print the String comma separated
$comma_separated_string = implode(",", $the_mail);
echo "$comma_separated_string";



greets martin
Martin K.
Posted: 01/27/2005, 12:14 AM

Whats Up?
Works?

Martin
aewhite901

Posts: 36
Posted: 01/27/2005, 2:58 AM

Thanks Martin,
Sory, I forgot all about leaving the question.
Appreciate your efforts and yes it does work.

thanks again
Tony White
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.