[PHP] Looking for help from a lovely php coder

Status
Not open for further replies.
Administrator
Staff member
(>'.')> huh!?
Joined
Nov 14, 2001
Messages
30,910
Reaction score
23,189
Hi,

Basically i need my script to send emails via intervals not instantly, im not a coder so not sure, if someone can modify this so i can enter a variable which will allow me to determine how many emails to send in how many seconds that be appreciated.
 
Hi,

Basically i need my script to send emails via intervals not instantly, im not a coder so not sure, if someone can modify this so i can enter a variable which will allow me to determine how many emails to send in how many seconds that be appreciated.

Give me 15 minutes and i'll have it ready <3

Or atleast I think I'm a little rusty considering I've been putting all my time into C# and Java but should be easy.

Question:

Does this get loaded everytime someone loads a page on the website or does an Admin/Moderator have to execute this manually?

Easiest way would probably be everytime a page loads but that would require an additional MySQL Column to store timing.

Also:

Since this forum is pretty big if you were to add this here you should consider adding a stack-like table for storing emails and email addresses and consider sending... say 5 emails and erasing them from the stack for everytime the page loads. ( That way if the server starts to get less traffic people won't start lagging from waiting for the PHP script to execute )

/ontopic

LOL @ 69 Posts

xD

/offtopic

This script is to view your emailing list and then an admin can use this to send emails to them correct?... Well are you trying to do a sort-of mailing list that will send them updates when you update the site or are you gonna be sending them data about them selves? (IE: Posts, Threads, etc... )
 
Last edited:
Answer 1 :its my mailing list code, so its sent via myself only
Answer 2: Yes its from my mailing list for my topsites but it sends them all straight off, sadly hotmail regulate the incoming emails and block them so i need to send them at intervals.

m

---------- Post added at 06:31 PM ---------- Previous post was at 06:31 PM ----------

Is the server running on Linux or on Windows?

linux, centos x64
 
Answer 1 :its my mailing list code, so its sent via myself only
Answer 2: Yes its from my mailing list for my topsites but it sends them all straight off, sadly hotmail regulate the incoming emails and block them so i need to send them at intervals.

m

---------- Post added at 06:31 PM ---------- Previous post was at 06:31 PM ----------



linux, centos x64

Do you want them to all be sent at once or do you want it to be like a worker that will fire off a few then wait for an interval then do more? ( In the interval case you'd have to leave your browser open since you don't want them being sent any other way o_o )
 
Are you trying to use this with vB?
I thought there was an option in vB allowing you to send emails in batches...

...

Ok, so let me get this straight.
All you want is a PHP script which will send a variable n number of emails in a variable m seconds?

No, design, just variables inside the script?
 
Last edited:
One of the best ways to manage an email list is through Awebber. Their system is very clean-cut and are one of the most trusted email list systems on the web. Good luck getting caught in spam with that system :P

If you choose not to use third party systems, then be sure to follow the CAN-SPAM act and your emails are less likely to come up as spam.

Here's a quote from FTC.gov,
http://www.ftc.gov/bcp/edu/pubs/business/ecommerce/bus61.shtm said:
* It bans false or misleading header information. Your email's "From," "To," and routing information
 
I think you guys mis understand, that script is already apart of a script im using which mass mails members, its my topsites.ragezone.com script, all i want is to be able to send it at desired intervals; ie;

send 1 email every 5 seconds.
 
I think you guys mis understand, that script is already apart of a script im using which mass mails members, its my topsites.ragezone.com script, all i want is to be able to send it at desired intervals; ie;

send 1 email every 5 seconds.

So do you want something like

PHP:
<?php
$interval = 5;//Interval is in seconds
$batchnum = 1;//Number of emails to send per batch

//Code...
?>
 
I think you guys mis understand, that script is already apart of a script im using which mass mails members, its my topsites.ragezone.com script, all i want is to be able to send it at desired intervals; ie;

send 1 email every 5 seconds.

To be perfectly honest, the script is too large for me to comprehend right now.

I see what you're saying though. You're not focused on anything except the interval part. Everything else you got down.

Also, I want to help, I just don't know where to stick my line of code. Perhaps you do?

If you do, well I understand you're not a coder, but if someone on this thread can find out where the loop is that goes through to send an email, if they could just put this in there to make it sleep 5 seconds,

PHP:
sleep(5);

Thanks :8:

Edit: Okay Well I went ahead and skimmed through the 1000 lines..

I found a section that sends emails to all the users,

PHP:
                                $sql = $udb->query("SELECT ".$this->f['email']." FROM ".$this->db['user']." WHERE ".$this->f['userid']." IN (".$_POST['users'].")");
				while ($row = $udb->fetch_array($sql))
				{
					$emails[] = $row['email'];
				}

				$emails = implode(',',$emails);

				$mailer				= new mailer;
				$mailer->to			= '';
				$mailer->bcc		= $emails;
				$mailer->subject	= $_POST['subject'];
				$mailer->usehtml	= $_POST['usehtml'];
				$mailer->from		= $settings['sitename']." Mailer|||".$settings['email'];
				$mailer->message	= $_POST['message'];
				@$mailer->sendmail();

It doesn't loop through, it emails everyone at once. That's the most efficient way to send emails to a list- And is the right way to do it. The problem with that is, there's no way to loop through and pause 5 seconds before each email is sent to an individual. Before any rational decisions are made to change the functionality of this system, are you absolutely sure that pausing a certain amount of seconds will fix the spam problem?

If so, it is possible to change the functionality to send an email to each user individually, though this isn't recommended due to much added performance. Also, closing the browser in the middle of a request will cause the form to quit half-way through. Additionally, 5 seconds extra wait-time will be added onto any performance load-time disadvantages.

Sorry, but I don't really see how having a set interval will prevent emails from showing up in spam.
 
Last edited:
Status
Not open for further replies.
Back