View Full Version : Sending mail, Perl and cron jobs :)
probedb
12-07-2006, 04:10 AM
Hi all,
A client of mine uses bluehost and I have a problem. Being a nightclub they have a mailing list which a few thousand people on it and want to be able to create mailouts from time to time.
Bluehost has spam protection to limit the mails to 500/hour which is all fine but for when these mailouts get sent.
I thought of a solution of basically dumping any emails that need to be sent into a database table, then calling a Perl script that's triggered by an hourly/bi-hourly cron job so it can process the table and send so many emails?
Does this sound like a reasonable plan? If so any thoughts on a Perl script to use....been a few years since I did Perl.
Cheers in advance!
Paul.
phprocket
12-07-2006, 04:24 AM
Hi all,
A client of mine uses bluehost and I have a problem. Being a nightclub they have a mailing list which a few thousand people on it and want to be able to create mailouts from time to time.
Bluehost has spam protection to limit the mails to 500/hour which is all fine but for when these mailouts get sent.
I thought of a solution of basically dumping any emails that need to be sent into a database table, then calling a Perl script that's triggered by an hourly/bi-hourly cron job so it can process the table and send so many emails?
Does this sound like a reasonable plan? If so any thoughts on a Perl script to use....been a few years since I did Perl.
Cheers in advance!
Paul.
HI..
Your plan sounds like a good one.. this is the system that some newsletter scripts use.. I am not quite sure if the 500 a hour is the limit they may have a daily limit also.. but like I said I am not quite sure.
You don't have to use CGI only.. you could also use php..
Make a database in mysql simular to this... making sure sent defaults to zero "0"
--------------------------
| id | email | sent |
--------------------------
Select email FROM table WHERE sent='0' LIMIT 500
Then select 500 and do a while statement and update each after they are sent.. marking sent as 1
;)
probedb
12-07-2006, 05:54 AM
Cheers for that :) It's exactly what I had in mind bar a few customisations for the emails that get sent out.
What command is it run a php file, just
php [phpfile including path]
?? Reason I wanted to use Perl was that PHP has a habit of timing out when you don't want it to :)
siguie
12-08-2006, 02:48 AM
Well it's a simple perl script to write just be sure to use CGI.pm and "strict". You may also want to look at phplist which is a full newsletter manager and can be configured to send out batches of emails per hour too.
I was going to do something very similar to that for a fansite I set up. But I haven't as yet. The only limit I'm aware of is 500/hour (if you get BH to increase it for you -- default is 50/hour).
PHP should be simple to do. But I don't know Perl, either... :P
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.