View Full Version : Auto Redirect: a solution for [Email Users] problems

26 Sep 2003, 06:20
If you ever had problems when sending an email to more than 200 users at once or if you got the silly error message: Problem Report (Timeout), this hack is made for you !


When you send a large number of emails at once (100-1000, depends on your server) using Email Users feature in the admin control panel, you propably get a timeout error message and that's because a certain time limit has ended while the emails are in the sending process.

A solution is to decrease the number of emails bieng sent at once, but this will force you to click the submit button in order to proceed to the next page, and this is difficult because you'll have a large number of pages.

e.g. if you have 10000 users in your forums, and you choose to send 100 messages at once, you'll have 100 pages, when every page finished loading, you must click (Do Next Page) button to proceed to next page!

Well, (Auto Redirect) hack will click the submit button in behalf of you :), using a small Java Script code, the emailing process will continue automatically, sending batch after batch until you email all users of your forum.


PLEASE make a backup of email.php, all changes are made in this file.
For your safety, always make a backup of your files before hacking it!

Open up email.php that is located in the Admin directory, and change the following:

1: find:
and right under this line, write:

2: couple of lines below, you'll find:
doformfooter("Do Next Page (page $page)",0);
On the line below it, place:
// automatic redirect
if ($redirect) {
echo '
<script language="javascript">
myvar = "";
timeout = 15;
function dorefresh() {
myvar = myvar + " .";
timerID = setTimeout("dorefresh();", 100);
if (timeout > 0) {
timeout -= 1;
else {
// automatic redirect

3: finally, find:
makeinputcode("Messages to send at once:","perpage","500");
and place the following code below it:
makeyesnocode("Auto redirect to next page?","redirect");


Hack Summary:

- Author: Private (privateman@flashmail.com)
- Tested on: all versions of vb 2.2.x and 2.3.x
- Support: post your questions in this thread only
- effects: 1 file effected (email.php)
- I strongly encourage vBulletin team to include this hack in VB3

26 Sep 2003, 14:10
ah please not yellow! Any color but not yellow ;)

There are a few guys who use the purple style and those can't read what you've written :)

>> Tested on: all versions of vb from 2.2.x to 2.3.0

what about 2.3.2 ?

26 Sep 2003, 21:05
Excellent idea for a hack - just what I need as I often have to send e-mails to users twice due to time-outs.

Cheers for the good work mate!

26 Sep 2003, 23:22
It works perfectly on vb 2.3.1 and 2.3.2

* I edited the thread and changed (tested on) line to:
Tested on: all versions of vb 2.2.x and 2.3.x

** no more yellow :)

27 Sep 2003, 07:22
This hack already exist:

Anyway, good work dude!

27 Sep 2003, 10:13

however, I did it myself, I think it's more integrated than the old one, and you can even use it or not depending on your choice.


Cold Steel
30 Apr 2004, 14:25
Can someone port this to vB3?

02 Jul 2004, 03:34
any hack for this in vb3 ?

23 Feb 2005, 22:55
yes need for vb3 :(

23 Mar 2005, 16:59
surely there is a vb3 hack for this

i have absolutley no idea what the use of clicking next page is - when i have 114,000 emails to send out

Marco van Herwaarden
23 Mar 2005, 17:29
vb3 Hack for this: http://www.vbulletin.org/forum/showthread.php?t=78550&highlight=redirect+mail