Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Mass Mail/Newsletters Via Cronjob Details »
Mass Mail/Newsletters Via Cronjob
Mod Version: 1.1, by Jafo232 (Coder) Jafo232 is offline
Developer Last Online: Jan 2020 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.3 Rating: (2 votes - 5.00 average) Installs: 32
Released: 04 Jan 2006 Last Update: 06 Jan 2006 Downloads: 81
Supported DB Changes Uses Plugins Additional Files  

For those of you who use the "Send Email to Users" function in the admin cp may have noticed it is less than efficient. This is really not the Vbulletin teams fault, it is just the fact that sending a lot of emails via PHP is like emptying lake with a bucket.

For administrators with a very large user base, sending email this way is not only very time consuming, but can be taxing on a servers resources.

With this extension, you can save your mass mailings or newsletters in a batch that can be sent at any time you wish, or on a schedule using a program like crontab.

You can even use a separate server to send the email if you wish.

Version 1.1 now supports the hack Send HTML via admin CP so you can batch mail HTML emails.



Requirements:

Perl (Some hosts call this CGI) w/ the DBI module (MySQL driver)
Net::SMTP module IF you plan on using SMTP (common Perl module)
Sendmail or SMTP
Access to crontab (for scheduled processing)
Telnet/SSH access to your server (for testing purposes only)

As for Telnet/SSH access, you will most likely need this unless you can schedule a cronjob via your servers admin GUI.


CHANGELOG:

01/05/2005: Added support for SMTP
01/05/2005: Modified code to include Vbulletin generated mail headers and encoding


Installation (detailed in readme file):

Install the product via your admin cp.

Open the list.cgi file and edit the database variables and upload to server IN ASCII MODE. Do not use Binary or Auto mode to upload list.cgi. You should upload this file in an area that is NOT accessible by a web browser.

Click Install

That is it. If you wish to use scheduled batches then you will have to set up a cronjob to execute the list.cgi file.

You can execute the list.cgi file any time you wish on your server like so:

"perl list.cgi"



What does this do exactly?:

In a nutshell, when you enter a message into the mass mail feature of Vbulletin, it saves the message details to a new table created by the product (massmail). When list.cgi is executed, it will go through this table and email everyone in the table and delete their entry after the mail is sent.



Usage:

The only thing you should do differently is set the "Emails to send at once" value to at least the amount of users you have registered. It defaults at 500 but the whole point of this hack is to eliminate having to send email in blocks and wait for the process to finish. Just set it to a real high number.



To Do:

For those Windows servers, I suppose the Send_Mail routine could use SMTP. This is not hard to do I just never use Windows servers so what's the point?

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Set mass moving / pruning of threads as a cronjob Stadler vBulletin 3.0 Beta Releases 3 06 Aug 2004 03:04

Comments
  #2  
Old 04 Jan 2006, 22:46
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Very nice idea! Thanks for sharing!
__________________
Logician's Blog | WebTemplates for vb 4.x : VB Integrated Content Management System
Reply With Quote
  #3  
Old 04 Jan 2006, 23:48
Man1c M0g's Avatar
Man1c M0g Man1c M0g is offline
 
Join Date: Jan 2004
Does this hack allow you to send HTML-based Newsletters, and can it send to members of a secondary usergroup? Because those abilities would be ULTRA useful!
Reply With Quote
  #4  
Old 05 Jan 2006, 00:34
silurius silurius is offline
 
Join Date: Oct 2004
Originally Posted by Man1c M0g
Does this hack allow you to send HTML-based Newsletters, and can it send to members of a secondary usergroup? Because those abilities would be ULTRA useful!
It's just a guess but I think this extension does not actually alter email format in any way, and focuses exclusively on send-related functionality.

Here's another mod that might do some of what you're after.
Reply With Quote
  #5  
Old 05 Jan 2006, 01:51
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Well, according to Perlmonks, there is a wrapper with Qmail that emulates sendmail:

http://www.perlmonks.com/?node_id=224380

Qmail comes with a wrapper (in /var/qmail/bin/sendmail, or in the bin directory of wherever you installed Qmail) that emulates sendmail nicely.
My guess is that all you do is enter /var/qmail/bin/sendmail as your sendmail path and it should work.
Reply With Quote
  #6  
Old 05 Jan 2006, 09:25
kadafi_alive kadafi_alive is offline
 
Join Date: Dec 2004
Hi, this might be a newbie question but how do you find out if you have:

Perl (Some hosts call this CGI) w/ the DBI module (MySQL driver)

installed?

Thanks in advance
Reply With Quote
  #7  
Old 05 Jan 2006, 12:24
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Real name: Josh
Thanks!
Reply With Quote
  #8  
Old 05 Jan 2006, 21:54
tuanluu's Avatar
tuanluu tuanluu is offline
 
Join Date: Aug 2005
thanks for sharing
Reply With Quote
  #9  
Old 05 Jan 2006, 22:01
tuanluu's Avatar
tuanluu tuanluu is offline
 
Join Date: Aug 2005
$path_to_sendmail = '/usr/lib/sendmail'; -------> for win 2003 what should I put?

"Upload the list.cgi file IN ASCII (NOT BINARY OR AUTO) mode somewhere on your server where it CANNOT be accessed by a browser or any other user except yourself." -------> you mean anywhere on my server or in forum root? for example c:\secure
Reply With Quote
  #10  
Old 05 Jan 2006, 22:43
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Originally Posted by kadafi_alive
Hi, this might be a newbie question but how do you find out if you have:

Perl (Some hosts call this CGI) w/ the DBI module (MySQL driver)

installed?

Thanks in advance
Well, most hosts have Perl installed, but your host may be able to tell you. Generally Perl installations also have DBI installed, but you will know pretty quick when you run the Perl script because it will throw a visible error saying it cannot find the module.
Reply With Quote
  #11  
Old 05 Jan 2006, 22:45
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Originally Posted by tuanluu
$path_to_sendmail = '/usr/lib/sendmail'; -------> for win 2003 what should I put?

"Upload the list.cgi file IN ASCII (NOT BINARY OR AUTO) mode somewhere on your server where it CANNOT be accessed by a browser or any other user except yourself." -------> you mean anywhere on my server or in forum root? for example c:\secure

Where is your Sendmail program located? Most Windows servers do not have Sendmail, so your probably out of luck until I write up an SMTP routine.

As for your second question, I do not think the instructions were vague, put is somewhere where nobody can access it via a web browser. Where that is on your system, only you and your host will know that.
Reply With Quote
  #12  
Old 05 Jan 2006, 22:57
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
Interesting .... I slightly modified the existing vb mail system to process it's queue every 15 minutes via a vb cron job - pretty much the same end result, but using the existing mail tables and system. I had considered releasing this at some point but this has probably saved me the effort now.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #13  
Old 05 Jan 2006, 23:08
tuanluu's Avatar
tuanluu tuanluu is offline
 
Join Date: Aug 2005
okay thanks for quick reply
Reply With Quote
  #14  
Old 05 Jan 2006, 23:10
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Originally Posted by Paul M
Interesting .... I slightly modified the existing vb mail system to process it's queue every 15 minutes via a vb cron job - pretty much the same end result, but using the existing mail tables and system. I had considered releasing this at some point but this has probably saved me the effort now.
Using the vb cronjob would probably cause the same issues for large userbases as PHP will still hang (and possibly timeout) with large mailings.

I usually prefer to write up a separate tables for my hacks just so they do not muck with user data by accident (faulty uninstalls, etc).
Reply With Quote
  #15  
Old 06 Jan 2006, 00:43
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Ok, I added SMTP support for you Windows users.

I also modified the code so it will be compatible with the HTML hack here .

I also modified the code a bit to use the Vbulletin headers which is needed for the HTML hack and non English sites.

Just uninstall product, and re-install and you are all set.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 15:53.

Layout Options | Width: Wide Color: