need some help... don't know where to start
Moderator: General Moderators
need some help... don't know where to start
I have a file with 5000 lines of
email, password, name
what i want to do is read thru that file 1 line at a time and generate
5000 email messages to each address once and start off the email as
Hello $name,
blah blah
thanks, jim
Any help would be loved... I'm clueless how to start
email, password, name
what i want to do is read thru that file 1 line at a time and generate
5000 email messages to each address once and start off the email as
Hello $name,
blah blah
thanks, jim
Any help would be loved... I'm clueless how to start
so easy...
Code: Select all
$f=file("your_file.txt");
$size=sizeof($f);
for ($i=0; $i<=$size; $i++)
{
$line=explode(",", $fї$i]);
$email=$lineї0];
$name=$lineї2];
mail($email, "Hello $name", "blah blah.....");
}No, I really don't think it will.
The best way would either to use a perl shell script to run through the file, and use Sendmail directly, OR to use PHP.
The way PHP would do it would be
1. Popup a little window, and process 10 emails at a time.
2. Refresh the window every 5 seconds, and process 10 more emails.
3. Use sessions to keep track of which emails you are one.
4. It make take some time to run through all of them, but this method works for my newsletter.
The best way would either to use a perl shell script to run through the file, and use Sendmail directly, OR to use PHP.
The way PHP would do it would be
1. Popup a little window, and process 10 emails at a time.
2. Refresh the window every 5 seconds, and process 10 more emails.
3. Use sessions to keep track of which emails you are one.
4. It make take some time to run through all of them, but this method works for my newsletter.
well then...
you should lemme borrow yoru script *wink wink*
this look about right?
Parse error line 4? ocunt() doesn't work either...
Any clue?
Any clue?
Code: Select all
<?
$file = file("b4.txt");
$newfile = file("after.txt")
$size = sizeof($file);
for ($i; $i<$size; $i++;)
{
$line = expode(",",$fileї$i]);
$addy = $lineї1];
$msg .= $addy;
$newmsg = "$msg".';'."
";
$myfile = @fopen($newfile,"a+") or die ("fopen failed");
@fwrite($myfile, $newmsg) or die("fwrite failed");
fclose($myfile);
}
?>*points to http://www.php.net/manual/en/function.file.php* while loop while loop! While loops are supposed to be used when there is an unknown value, for loops are for when you know the amount of times the loop will run! Hope that helps.
okie...
Code: Select all
<?
$file = file("westol.txt");
$newfile = file("westolemails.txt");
$size = sizeof($file);
$i=1;
while($i <= $size)
{
$line = explode(",",$fileї$i]);
$addy = $lineї1];
$msg = $addy;
$newmsg .= "$msg".';'."
";
$myfile = fopen($newfile,"a+") or die ("fopen failed");
fwrite($myfile, $newmsg) or die("fwrite failed");
fclose($myfile);
$i++;
}
?>Stil getting errors out the butt...
Code: Select all
Warning: Undefined variable: msg in d:htmluserspianodbcomhtml estindex.php on line 12
Warning: Undefined variable: newmsg in d:htmluserspianodbcomhtml estindex.php on line 14
Warning: Array to string conversion in d:htmluserspianodbcomhtml estindex.php on line 16
Warning: fopen("Array","a+") - Permission denied in d:htmluserspianodbcomhtml estindex.php on line 16
fopen failed- EvilWalrus
- Site Admin
- Posts: 209
- Joined: Thu Apr 18, 2002 3:21 pm
- Location: Springmont, PA USA