Re: [PHP] What solution to use for mass newsletter mailing reporting?

2003-03-06 Thread Lowell Allen
In my case the client's list is about 1500 addresses and they send every 2-3
weeks. The client wanted a way to recover if sending failed mid-list -- a
way to know where to pick up again. A post to the list described a queuing
system similar to the one I built, so check the archives if you end up
building one yourself.

In my preliminary tests it took much longer to send emails than 250 in 15
seconds! Sending test batches of 100, I got ranges from 27 seconds to 202
seconds, with the average time about 73 seconds for 100 emails. During these
tests I was writing a counter to a flat file each time through the loop,
which probably slows the process down a little, but I don't think that would
account for the dramatic differences in speeds between your tests and mine.

About bounce backs -- on the commercial host I'm using, each domain comes
with web mail accounts. The default user for the account corresponds to the
account username for FTP access. Other usernames/passwords can be added and
can receive email at [EMAIL PROTECTED]. By setting up the crontab to execute
as a specific user, that user email address is listed in the email header as
the return-path and bounced/undeliverable email goes to that user email
account. Someone at the client company monitors that address, verifies the
bounce, and manually removes the address from the list.

Good luck with your project!

--
Lowell Allen

 From: J J [EMAIL PROTECTED]
 Date: Wed, 5 Mar 2003 16:34:44 -0800 (PST)
 To: PHP [EMAIL PROTECTED]
 Subject: Re: [PHP] What solution to use for mass newsletter mailing 
 reporting?
 
 Interesting way of tracking everything... and I like
 the idea of the pop-up being able to query the
 database for current status.
 
 For now, I'm firing off a process with no timeout and
 it can run even after browser abort... but no real way
 to check on it other than I send a mailing complete
 type email with some of the mailing details.
 
 I was able to send 250 emails within 15 seconds, so
 roughly 1000 a minute.  Not sure if this is because
 the server load is light, or the server is just that
 powerful. Does this seem right???
 
 
 I'd like to find out more how you handle the bounce
 backs.
 
 Again, thanks for the great information.
 
 
 
 --- Lowell Allen [EMAIL PROTECTED] wrote:
 - It takes several minutes to send hundreds of
 emails, so it's best done in
 the background. You'll need PHP available to run as
 a CGI/CLI called from a
 cron tab.
 
 - My solution is part of a content management
 system. Site administrators
 create the body of the email from database info.
 When a user hits the send
 button, the email is saved to a MySQL table which
 has fields for Time (time
 created), ListSize (number of addresses), Invalids
 (bad address formats),
 Attempts, and InProgress (an enum field used as a
 flag). There are lots more
 fields for storing parts of the message, etc., but
 that's not important to
 the approach. There's also a database table for
 storing the email address
 list, with fields for Time (same as the message
 table), Valid (valid
 format), Failed, Attempted, and TimeAttempted.
 
 
 __
 Do you Yahoo!?
 Yahoo! Tax Center - forms, calculators, tips, more
 http://taxes.yahoo.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] What solution to use for mass newsletter mailing reporting?

2003-03-05 Thread J J
What do you use for mass newsletter mailing say for
5000+ members every month?  At the same time, I'd like
to be able to track who opened the message, any links
they clicked inside the message, bounced messages,
etc.

I keep seeing reports that PHP/mail have trouble
sending more than a few hundred messages depending on
the machine.   But for mass mailings you get into
majordomo, etc, which seems to bulky for my needs.

Any thoughts or suggestions on possible solutions? 
Thank you in advance!

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What solution to use for mass newsletter mailing reporting?

2003-03-05 Thread Lowell Allen
 From: J J [EMAIL PROTECTED]
 
 What do you use for mass newsletter mailing say for
 5000+ members every month?  At the same time, I'd like
 to be able to track who opened the message, any links
 they clicked inside the message, bounced messages,
 etc.
 
 I keep seeing reports that PHP/mail have trouble
 sending more than a few hundred messages depending on
 the machine.   But for mass mailings you get into
 majordomo, etc, which seems to bulky for my needs.
 
 Any thoughts or suggestions on possible solutions?
 Thank you in advance!

This general question is asked often, and I found lots of good information
by searching the list archives. So check the archives, read the manual, read
whatever articles you can find. (Check zend.com and sitepoint.com.) This
will give you all the info you need to successfully send to a small list --
verify you can do that. Assuming you've got that down, here's a quick
description of the system I built on a commercial Linux host using a MySQL
database:

- It takes several minutes to send hundreds of emails, so it's best done in
the background. You'll need PHP available to run as a CGI/CLI called from a
cron tab.

- My solution is part of a content management system. Site administrators
create the body of the email from database info. When a user hits the send
button, the email is saved to a MySQL table which has fields for Time (time
created), ListSize (number of addresses), Invalids (bad address formats),
Attempts, and InProgress (an enum field used as a flag). There are lots more
fields for storing parts of the message, etc., but that's not important to
the approach. There's also a database table for storing the email address
list, with fields for Time (same as the message table), Valid (valid
format), Failed, Attempted, and TimeAttempted.

- The cron tab calls a PHP script every five minutes which queries the
database message table for fields where ListSize-Invalids  Attempts and
InProgress = N. If the result set is less than 1, the script exits.
Otherwise, it sets the InProgress flay to Y and selects 50 email addresses
from the addresses table where Attempted = N and Valid = Y and Time
matches Time from the message table.

- The sending PHP script then loops through the 50 addresses, and each time
through the loop updates the address table for the address being processed,
setting Attempted to Y, Failed to Y or N, and TimeAttempted to a
timestamp value. After finishing the 50-address loop, the script updates the
message table to set Attempts to a greater value and InProgress to N.

- Finally, the sending script selects all completed messages (where
ListSize-Invalids = Attempts and InProgress = N), orders the selection by
Time descending, and deletes all but the most recent, and also deletes the
Time-matching email addresses from the address table. This means that only
active info and the last-completed mailing info is kept in the database.

- Another nice thing about running the sending script as a CLI is that when
a PHP script running as a module sends email, the return-path in the email
header is listed as something like [EMAIL PROTECTED] and bounced email
isn't accessible. (This is true on the commercial host I'm using, anyway.)
But when the PHP script runs as a CGI, the return-path can be set to the
user and the bounces are accessible.

- Using the info stored in the message table and address table, I can
produce a report on a mailing attempt. I also built a pop up window that
refreshes every few minutes so I can monitor the progress of sending to a
large list.

There are lots of other details, of course, but it took too long to describe
the general approach -- whew! Anyway, for anyone struggling with this sort
of thing, building a queuing system like this seems to work well, and I'm
sure it would be safe to greatly increase the speed above 50/5 minutes.

HTH

--
Lowell Allen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What solution to use for mass newsletter mailing reporting?

2003-03-05 Thread J J
Interesting way of tracking everything... and I like
the idea of the pop-up being able to query the
database for current status.

For now, I'm firing off a process with no timeout and
it can run even after browser abort... but no real way
to check on it other than I send a mailing complete
type email with some of the mailing details.  

I was able to send 250 emails within 15 seconds, so
roughly 1000 a minute.  Not sure if this is because
the server load is light, or the server is just that
powerful. Does this seem right???


I'd like to find out more how you handle the bounce
backs.

Again, thanks for the great information.



--- Lowell Allen [EMAIL PROTECTED] wrote:
 - It takes several minutes to send hundreds of
 emails, so it's best done in
 the background. You'll need PHP available to run as
 a CGI/CLI called from a
 cron tab.
 
 - My solution is part of a content management
 system. Site administrators
 create the body of the email from database info.
 When a user hits the send
 button, the email is saved to a MySQL table which
 has fields for Time (time
 created), ListSize (number of addresses), Invalids
 (bad address formats),
 Attempts, and InProgress (an enum field used as a
 flag). There are lots more
 fields for storing parts of the message, etc., but
 that's not important to
 the approach. There's also a database table for
 storing the email address
 list, with fields for Time (same as the message
 table), Valid (valid
 format), Failed, Attempted, and TimeAttempted.
 

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php