phpmailer - need help for bulk mailing

phpmailer - need help for bulk mailing

am 10.04.2008 10:44:56 von florencec2046

Hi all,

I am new to php and mysql.

I have set up the mailing list in mysql database and used phpmailer to
send mass mailing.

The program code is similar to

http://phpmailer.codeworxtech.com/examples.html

(1. Advanced Example) and I have added some feedback message so that I
know which mail has error :

if(!$mail->Send()) {
echo "There has been a mail error sending to " . $row["e-
mail"] . "
";

} else {
echo "Mail sent ". $row["e-mail"] . "
";

------------------------------------------------------------ ------------------------------------------------------------ --

Due to the limit of the php program or SMTP server, the browser
expired in 30 seconds. I am limited to send 50 mails at a time. It's
OK for sending a few hundreds e-mail. However, I have spent 4 hours
last night to send 2,800 e-mails.

Would anyone kindly show me how to write a batch program so that I can
automate the progress. I would like to keep the tracking report in
browser or text file too.

Thanks you.

Florence

Re: phpmailer - need help for bulk mailing

am 10.04.2008 11:13:12 von James Ravenscroft

On Apr 10, 9:44=A0am, florencec2...@gmail.com wrote:
> Hi all,
>
> I am new to php and mysql.
>
> I have set up the mailing list in mysql database and used phpmailer to
> send mass mailing.
>
> The program code is similar to
>
> http://phpmailer.codeworxtech.com/examples.html
>
> (1. Advanced Example) and I have added some feedback message so that I
> know which mail has error :
>
> =A0if(!$mail->Send()) {
> =A0 =A0 =A0 =A0 echo "There has been a mail error sending to " . $row["e-
> mail"] . "
";
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else {
> =A0 echo "Mail sent =A0". $row["e-mail"] . "
";
>
> ------------------------------------------------------------ --------------=
-=AD-----------------------------------------------
>
> Due to the limit of the php program or SMTP server, the browser
> expired in 30 seconds. I am limited to send 50 mails at a time. It's
> OK for sending a few hundreds e-mail. However, I have spent 4 hours
> last night to send 2,800 e-mails.
>
> Would anyone kindly show me how to write a batch program so that I can
> automate the progress. I would like to keep the tracking report in
> browser or text file too.
>
> Thanks you.
>
> Florence

Florence,

I don't know what others would recommend but I would certainly go down
the path of implementing a PHP-CLI script and a trigger for the web
browser.

instead of print build a log function such as:

function mail_log($text){
$f =3D fopen("log.txt",'ab');
fwrite($f, $text."\n");
fclose($f);
}

Set all instances of "print" in your current script to this new
function.

You'll also need to add the following to your script at the top of the
file:

#!/usr/bin/php -q

Then create a web based trigger that instructs the server to use php
to execute it like below:

passthru("./massmail.php");
?>

When its finished, you can see if anything went wrong by looking at
log.txt

Anyone else have an opinion on this one?

Re: phpmailer - need help for bulk mailing

am 10.04.2008 17:15:45 von florencec2046

On Apr 10, 5:13 pm, James Ravenscroft wrote:
> On Apr 10, 9:44 am, florencec2...@gmail.com wrote:
>
>
>
> > Hi all,
>
> > I am new to php and mysql.
>
> > I have set up the mailing list in mysql database and used phpmailer to
> > send mass mailing.
>
> > The program code is similar to
>
> >http://phpmailer.codeworxtech.com/examples.html
>
> > (1. Advanced Example) and I have added some feedback message so that I
> > know which mail has error :
>
> > if(!$mail->Send()) {
> > echo "There has been a mail error sending to " . $row["e-
> > mail"] . "
";
>
> > } else {
> > echo "Mail sent ". $row["e-mail"] . "
";
>
> > ------------------------------------------------------------ ------------=
---=AD-----------------------------------------------
>
> > Due to the limit of the php program or SMTP server, the browser
> > expired in 30 seconds. I am limited to send 50 mails at a time. It's
> > OK for sending a few hundreds e-mail. However, I have spent 4 hours
> > last night to send 2,800 e-mails.
>
> > Would anyone kindly show me how to write a batch program so that I can
> > automate the progress. I would like to keep the tracking report in
> > browser or text file too.
>
> > Thanks you.
>
> > Florence
>
> Florence,
>
> I don't know what others would recommend but I would certainly go down
> the path of implementing a PHP-CLI script and a trigger for the web
> browser.
>
> instead of print build a log function such as:
>
> function mail_log($text){
> $f =3D fopen("log.txt",'ab');
> fwrite($f, $text."\n");
> fclose($f);
>
> }
>
> Set all instances of "print" in your current script to this new
> function.
>
> You'll also need to add the following to your script at the top of the
> file:
>
> #!/usr/bin/php -q
>
> Then create a web based trigger that instructs the server to use php
> to execute it like below:
>
> > passthru("./massmail.php");
> ?>
>
> When its finished, you can see if anything went wrong by looking at
> log.txt
>
> Anyone else have an opinion on this one?


Thank you for introducing PHP CLI. I will definitely study it (new to
me) and try it out.

Re: phpmailer - need help for bulk mailing

am 10.04.2008 17:16:04 von florencec2046

On Apr 10, 5:13 pm, James Ravenscroft wrote:
> On Apr 10, 9:44 am, florencec2...@gmail.com wrote:
>
>
>
> > Hi all,
>
> > I am new to php and mysql.
>
> > I have set up the mailing list in mysql database and used phpmailer to
> > send mass mailing.
>
> > The program code is similar to
>
> >http://phpmailer.codeworxtech.com/examples.html
>
> > (1. Advanced Example) and I have added some feedback message so that I
> > know which mail has error :
>
> > if(!$mail->Send()) {
> > echo "There has been a mail error sending to " . $row["e-
> > mail"] . "
";
>
> > } else {
> > echo "Mail sent ". $row["e-mail"] . "
";
>
> > ------------------------------------------------------------ ------------=
---=AD-----------------------------------------------
>
> > Due to the limit of the php program or SMTP server, the browser
> > expired in 30 seconds. I am limited to send 50 mails at a time. It's
> > OK for sending a few hundreds e-mail. However, I have spent 4 hours
> > last night to send 2,800 e-mails.
>
> > Would anyone kindly show me how to write a batch program so that I can
> > automate the progress. I would like to keep the tracking report in
> > browser or text file too.
>
> > Thanks you.
>
> > Florence
>
> Florence,
>
> I don't know what others would recommend but I would certainly go down
> the path of implementing a PHP-CLI script and a trigger for the web
> browser.
>
> instead of print build a log function such as:
>
> function mail_log($text){
> $f =3D fopen("log.txt",'ab');
> fwrite($f, $text."\n");
> fclose($f);
>
> }
>
> Set all instances of "print" in your current script to this new
> function.
>
> You'll also need to add the following to your script at the top of the
> file:
>
> #!/usr/bin/php -q
>
> Then create a web based trigger that instructs the server to use php
> to execute it like below:
>
> > passthru("./massmail.php");
> ?>
>
> When its finished, you can see if anything went wrong by looking at
> log.txt
>
> Anyone else have an opinion on this one?


Thank you for introducing PHP CLI. I will definitely study it (new to
me) and try it out.

Re: phpmailer - need help for bulk mailing

am 11.04.2008 04:47:03 von Manuel Lemos

Hello,

on 04/10/2008 05:44 AM florencec2046@gmail.com said the following:
> Hi all,
>
> I am new to php and mysql.
>
> I have set up the mailing list in mysql database and used phpmailer to
> send mass mailing.
>
> The program code is similar to
>
> http://phpmailer.codeworxtech.com/examples.html
>
> (1. Advanced Example) and I have added some feedback message so that I
> know which mail has error :
>
> if(!$mail->Send()) {
> echo "There has been a mail error sending to " . $row["e-
> mail"] . "
";
>
> } else {
> echo "Mail sent ". $row["e-mail"] . "
";
>
> ------------------------------------------------------------ ------------------------------------------------------------ --
>
> Due to the limit of the php program or SMTP server, the browser
> expired in 30 seconds. I am limited to send 50 mails at a time. It's
> OK for sending a few hundreds e-mail. However, I have spent 4 hours
> last night to send 2,800 e-mails.
>
> Would anyone kindly show me how to write a batch program so that I can
> automate the progress. I would like to keep the tracking report in
> browser or text file too.

Here is a class that provides a clever solution to do exactly what you need:

http://www.phpclasses.org/obuffer

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/