![]() |
Automatic "Send Email" redirect
Do you run a large forum, and need to send emails to all your users? Do you have to set the email per batch to a low number because of PHP limitations? And most importantly; would you have liked to see the emails work their magic while you go attend other duties?
If your answer to the aboves is yes, then this hack is for you! What this hack does, is cache the email you are trying to send in a temporary SQL table, then instead of having a form with hidden fields and forcing you to hit submit, it reads this table at reload. After the mail is sent, the table is emptied. Thanks goes to DeMiNe0 for telling me to make this, and for helping me test it :) Files modified: 1 DB Tables added: 1 Difficulty: Easy |
good thing Revan, but there is a missing Replace, line WHEN searching FOR if (!$_POST['test'])... line 177 and on...
we replace it with what here?! |
Fix'd.
Cheers :) |
I did all the changes to the php file
But I am a newby and dont know what exactly is meant by this. I ran the qery but i dont know what is meant by the final words in the text below. Remember to add a prefix if you use it. - What prefix. I ran the query - but it said it changed 0 rows . Help!! Run this query: _________________ CREATE TABLE `mailtemp` ( `test` tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, `message` mediumtext NOT NULL, `subject` mediumtext NOT NULL, `from` mediumtext NOT NULL, `serializeduser` mediumtext NOT NULL ) TYPE=MyISAM; Remember to add a prefix if you use it. |
Well in your config.php, if you have the "$tableprefix" set to anything, that is what you needed to add.
And even if you do not have a prefix, you ran the query correctly, because it is not supposed to change any rows ;) As long as you don't get errors when sending a mail using this redirect, you did everything correctly :) |
When i go to 'send email to users' now in the control panel - above the blue - i have the text over a white background saying
if ($_REQUEST['do'] == 'dosendmail' OR $_POST['do'] == 'makelist') { if (!$_GET['isredirect']) { $message = $_POST['message']; $perpage = $_POST['perpage']; $startat = $_POST['startat']; $subject = $_POST['subject']; $from = $_POST['from']; $serializeduser = $_POST['serializeduser']; } else { $perpage = $_GET['perpage']; $startat = $_GET['startat']; $mailtemp = $DB_site->query_first("SELECT * FROM `" . TABLE_PREFIX . "mailtemp`"); $message = $mailtemp['message']; $subject = $mailtemp['subject']; $from = $mailtemp['from']; $serializeduser = $mailtemp['serializeduser']; $test = $mailtemp['test']; } if (isset($serializeduser)) { $_POST['user'] = @unserialize($serializeduser); Also at the generate email list page i have the text if ($_REQUEST['do'] == 'dosendmail' OR $_POST['do'] == 'makelist') { if (!$_GET['isredirect']) { $message = $_POST['message']; $perpage = $_POST['perpage']; $startat = $_POST['startat']; $subject = $_POST['subject']; $from = $_POST['from']; $serializeduser = $_POST['serializeduser']; } else { $perpage = $_GET['perpage']; $startat = $_GET['startat']; $mailtemp = $DB_site->query_first("SELECT * FROM `" . TABLE_PREFIX . "mailtemp`"); $message = $mailtemp['message']; $subject = $mailtemp['subject']; $from = $mailtemp['from']; $serializeduser = $mailtemp['serializeduser']; $test = $mailtemp['test']; } if (isset($serializeduser)) { $_POST['user'] = @unserialize($serializeduser); |
Are you sure you did the file changes correctly?
Because it seems to me like it echo's the entire script... :P |
My table prefix is not set to anything. I just checked config.php
|
I will reload the default page and do the changes again - tomorrow. Thanks
|
i get an error on the first attempt at an auto re direct to next page - code has been applied 1:1 as per instructions
using vb 3.07 - query successfully executed and checked in phpmyadmin with no errors Code:
Database error in vBulletin 3.0.7: |
All times are GMT. The time now is 03:28 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|