473,396 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

massive mails & timeout

Hi,

I have a web site that sends emails to some 17000 newsletter
subscribers, the script takes about 5 minutes to complete the task,
depending of the size of the attachment.
The problem is that sometime it takes so much time that is difficult
to know if something is going wrong, and sometimes the script
terminates with timeout.
I thought to solve the timeout question with a set_limit_time() but i
am not sure where to put this line: inside the loop that send emails
or at the beginning of the page?
Second question is, how to control the flow and avoid that the site
administrator close the browser or click the stop button thinking that
the site is not working? could register_shutdown_function be the
solution?

thanks,

stefano
Oct 3 '08 #1
4 2598
On 3 Oct, 10:34, "stefano.troi...@gmail.com"
<stefano.troi...@gmail.comwrote:
Hi,

I have a web site that sends emails to some 17000 newsletter
subscribers, the script takes about 5 minutes to complete the task,
depending of the size of the attachment.
The problem is that sometime it takes so much time that is difficult
to know if something is going wrong, and sometimes the script
terminates with timeout.
I thought to solve the timeout question with a set_limit_time() but i
am not sure where to put this line: inside the loop that send emails
or at the beginning of the page?
Second question is, how to control the flow and avoid that the site
administrator close the browser or click the stop button thinking that
the site is not working? could register_shutdown_function be the
solution?
Have a google for php long running process.

The short answer is that you're never going to get this running
reliably on a remote server via a browser - run it from the comand
line.

C.
Oct 3 '08 #2
st*************@gmail.com wrote:
Hi,

I have a web site that sends emails to some 17000 newsletter
subscribers, the script takes about 5 minutes to complete the task,
depending of the size of the attachment.
The problem is that sometime it takes so much time that is difficult
to know if something is going wrong, and sometimes the script
terminates with timeout.
I thought to solve the timeout question with a set_limit_time() but i
am not sure where to put this line: inside the loop that send emails
or at the beginning of the page?
Second question is, how to control the flow and avoid that the site
administrator close the browser or click the stop button thinking that
the site is not working? could register_shutdown_function be the
solution?

thanks,

stefano
Don't even try to send that many emails from a web page. Do it
asynchronously instead.

Rather, save the information in a database and run a cron job to send a
few, then restart itself to send a few more. Or use one of the many
bulk email packages out there (which basically do the same thing).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Oct 3 '08 #3
On 3 okt, 11:34, "stefano.troi...@gmail.com"
<stefano.troi...@gmail.comwrote:
Hi,

I have a web site that sends emails to some 17000 newsletter
subscribers, the script takes about 5 minutes to complete the task,
depending of the size of the attachment.
The problem is that sometime it takes so much time that is difficult
to know if something is going wrong, and sometimes the script
terminates with timeout.
I thought to solve the timeout question with a set_limit_time() but i
am not sure where to put this line: inside the loop that send emails
or at the beginning of the page?
Second question is, how to control the flow and avoid that the site
administrator close the browser or click the stop button thinking that
the site is not working? could register_shutdown_function be the
solution?

thanks,

stefano
We did a newsletter script for a customer a while ago that would send
out 30k mails.
All the newsletters (id's) went into a database, and a cronjob started
a php script every 5 minutes or so.
The script checked the database for new newsletters to send and would
send them out in bursts of 180 letters per 5 minutes.

We don't send all the newsletters at once because of the possibility
of getting the mailserver blacklisted.

Hope it helps

Cheers

Daniel
Oct 3 '08 #4
On 3 oct, 15:23, DaanK Interworking <daankinterwork...@gmail.com>
wrote:
On 3 okt, 11:34, "stefano.troi...@gmail.com"

<stefano.troi...@gmail.comwrote:
Hi,
I have a web site that sends emails to some 17000 newsletter
subscribers, the script takes about 5 minutes to complete the task,
depending of the size of the attachment.
The problem is that sometime it takes so much time that is difficult
to know if something is going wrong, and sometimes the script
terminates with timeout.
I thought to solve the timeout question with a set_limit_time() but i
am not sure where to put this line: inside the loop that send emails
or at the beginning of the page?
Second question is, how to control the flow and avoid that the site
administrator close the browser or click the stop button thinking that
the site is not working? could register_shutdown_function be the
solution?
thanks,
stefano

We did a newsletter script for a customer a while ago that would send
out 30k mails.
All the newsletters (id's) went into a database, and a cronjob started
a php script every 5 minutes or so.
The script checked the database for new newsletters to send and would
send them out in bursts of 180 letters per 5 minutes.

We don't send all the newsletters at once because of the possibility
of getting the mailserver blacklisted.

Hope it helps

Cheers

Daniel
Thanks for your answers, the problem is that I am not the sysadmin of
the server, only the webmaster and I don't have full access to it.

@ Daniel, could you tell me more about your script? I have never done
something similar, you can use my private email if you like it.

many thanks,

stefano
Oct 5 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: nasht | last post by:
Hi, I'm trying to make a newsletter application in php (using mail() ). This application is supposed to look in a MySQL database and generate a list of emails and first names. Then it should...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: SevDer | last post by:
Hi We have a case where client clicks a button and series of events take place which some of them are web service calls. And sometimes, we are receiving ThreadAbortException on the final steps...
13
by: =?Utf-8?B?ZG91Zw==?= | last post by:
I support several intranet sites one of which had NO STATE. Even though content has ASP extensions, it was all rendered HTML. Site had NO session or application variables being managed. Site had...
0
by: teddy06 | last post by:
I have written code for read mails from exchange server. I have used webdav in my code. Its was working fine once upon a time. Currently configuration settings of client has been changed . so i...
1
by: sbettadpur | last post by:
Hi everybody, Iam struggling for retrieve mails from mail server using perl iam facing some problem in blow my code even i have the mails in my mailserver iam not getting the count of mails...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.