473,385 Members | 1,732 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,385 software developers and data experts.

massive email

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 send an html formated message.
In the theory, I know how to do that, but the hic is ... There are
about 30 000 members.
So I get different kind of errors everytime I try something.
Like 500 Internal Server Error,
or the page would load forever and actually not do everything,
or I would get "Fatal error: Allowed memory size of 8388608 bytes
exhausted at (null):0 (tried to allocate 129 bytes)" ...

I tried both my sending multiple mail() functions in a loop (the way i
prefer), and only one mail() function with the whole coma-separated
list of emails.

Is there an easy way to send massive email?
Please help.

Thank You,

Nathan

Jul 17 '05 #1
12 5076
Hello,

I've never written an application to send such large batches of email,
but I may be of some help. Since the script is going to take some time
to run, it's not a good candidate for a web-based script. Instead, I
would create a script (could still be written in PHP) that runs
independently of the web server (e.g., apache) so you won't have to
worry about timeouts, etc. Shell access would be very helpful for
testing this.

I would call mail() with one email address per call, not a large
comma-separated list.

Hopefully someone with specific experience with mass emailing can help
more here.

Mark Aardsma

Jul 17 '05 #2
I noticed that Message-ID:
<11**********************@z14g2000cwz.googlegroups .com> from nasht
contained the following:
Then it should send an html formated message.


Good. That'll make sure it hits the bit bucket good and fast with me.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3
In article <11**********************@f14g2000cwb.googlegroups .com>,
ma**@aatechservices.com says...
I've never written an application to send such large batches of email,
but I may be of some help.


I don't know if it's been mentioned, but sending LARGE batches of email
is very likely to get the sender black-listed or have their account
yanked by their provider. I know of instances where sending just 2500
emails, from a non-profit church, to people that provided their email
address, got their service disconnected.

--
--
sp*********@rrohio.com
(Remove 999 to reply to me)
Jul 17 '05 #4
In article <MP************************@news-server.columbus.rr.com>,
Leythos <vo**@nowhere.lan> wrote:
In article <11**********************@f14g2000cwb.googlegroups .com>,
ma**@aatechservices.com says...
I've never written an application to send such large batches of email,
but I may be of some help.


I don't know if it's been mentioned, but sending LARGE batches of email
is very likely to get the sender black-listed or have their account
yanked by their provider. I know of instances where sending just 2500
emails, from a non-profit church, to people that provided their email
address, got their service disconnected.

--


The non-profit I'm working with wants to do this to it's members. I
said for them not to or they're loose their internet connection. I
checked with their ISP and unless the list is double opt-in validated,
service would terminated almost immediately. That was a wake-up call
for them.

As an alternative, the ISP offered access to their mailing-list server
(majordomo) which is completely configurable. We created a list and you
have to send email to an address to request to be put on it. Then
confirm by replying a "Are you sure you want to do this?" email. It's a
simple matter to provide a button on the web site to "sign me up for
electronic notification" that sends the initial email.

My advise, don't send the large batches of email unless you've confirmed
the recipients want the email. And provide a way to "opt-out" when you
ignore this advise and send out the emails anyway.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #5

"nasht" <na*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Is there an easy way to send massive email?
Please help.


Hire a spammer? Write your own variant of Netsky?
Jul 17 '05 #6
Thanks for those advices.

For the first one given (run it on local), it's a good idea (except I
run Windows on a laptop, which i think is not that great for php).
Also it could only buy me a little bit more performance, not a large
scale solution (the website I work for is growing fast).

For the rest of the advices, they seemed more like legal advices.
I'm not really concerned about the legal stuff, that's not my
department :)
But of course I'll forward them your comments about that (will they
care? I don't know...)

But back to the technical issue itself, there has to be a way.
Very large scale companies do that sometimes (like Amazon, yahoo,
microsoft...).
Look up the email addresses, send them a message. It looks simple like
that. How do they do it?
They must have much more than 30 000 customers...

Thank You,

Nathan

Jul 17 '05 #7
On 17 Dec 2004 14:24:03 -0800, "nasht" <na*****@gmail.com> wrote:
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 send an html formated message.
Presumably you mean that it will send an HTML e-mail to those who
chose bloat and plain text to those who did not?
In the theory, I know how to do that, but the hic is ... There are
about 30 000 members.


IMO, your safest bet is to send the e-mail once - to an outsourced
delivery service, based upon a "double opt-in" list. That way you send
one e-mail and they handle the distribution to the validated
recipients. I can't tell where you are posting from, but the details
of a legitimate UK based service are at:
http://www.dsvr.co.uk/Services/E-Mar...Marketing.html

There is a point where re-inventing the wheel is pointless, and
30,000 recipients seems like you have passed it.

--
------------------------------------------------------------------
- Stuart Millington ALL HTML e-mail rejected -
- mailto:ph***@dsv1.co.uk http://w3.z-add.co.uk/ -
begin OE is broken read MS knowledgebase Q265230
Jul 17 '05 #8
On Fri, 17 Dec 2004 15:58:15 -0800, Michael Vilain
<vi****@spamcop.net> wrote:
The non-profit I'm working with wants to do this to it's members. I
said for them not to or they're loose their internet connection. I
checked with their ISP and unless the list is double opt-in validated,
service would terminated almost immediately. That was a wake-up call
for them.
One of work's customers was told this before they signed up to us.
Almost a year later, after spaming me (postmaster at their "ISP") they
have stated that they will ignore our T&C's and continue to use their
non-verified mailing list which they compiled in the years before
their contract with us. I would like to terminate their account now,
but I'm the only person they've spam'ed so far and they are friends
with the company directors :(
As an alternative, the ISP offered access to their mailing-list server
(majordomo) which is completely configurable. We created a list and you
have to send email to an address to request to be put on it. Then
confirm by replying a "Are you sure you want to do this?" email. It's a
simple matter to provide a button on the web site to "sign me up for
electronic notification" that sends the initial email.


I set that up for free for them (not Majordomo, which I've used for
internal lists, but a simpler script - mailman?) and they are still
unwilling to use it to validate their previously un-validated list. I
gave up :(

--
------------------------------------------------------------------
- Stuart Millington ALL HTML e-mail rejected -
- mailto:ph***@dsv1.co.uk http://w3.z-add.co.uk/ -
begin OE is broken read MS knowledgebase Q265230
Jul 17 '05 #9
In article <1h********************************@4ax.com>,
Stuart Millington <ne**@dsv1.co.uk> wrote:
On Fri, 17 Dec 2004 15:58:15 -0800, Michael Vilain
<vi****@spamcop.net> wrote:
The non-profit I'm working with wants to do this to it's members. I
said for them not to or they're loose their internet connection. I
checked with their ISP and unless the list is double opt-in validated,
service would terminated almost immediately. That was a wake-up call
for them.


One of work's customers was told this before they signed up to us.
Almost a year later, after spaming me (postmaster at their "ISP") they
have stated that they will ignore our T&C's and continue to use their
non-verified mailing list which they compiled in the years before
their contract with us. I would like to terminate their account now,
but I'm the only person they've spam'ed so far and they are friends
with the company directors :(
As an alternative, the ISP offered access to their mailing-list server
(majordomo) which is completely configurable. We created a list and you
have to send email to an address to request to be put on it. Then
confirm by replying a "Are you sure you want to do this?" email. It's a
simple matter to provide a button on the web site to "sign me up for
electronic notification" that sends the initial email.


I set that up for free for them (not Majordomo, which I've used for
internal lists, but a simpler script - mailman?) and they are still
unwilling to use it to validate their previously un-validated list. I
gave up :(


Just report the spammers to the Department of Homeland Security. Oops.
Wrong country. Never mind....

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #10
Hello,

on 12/17/2004 08:24 PM nasht said the following:
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 send an html formated message.
In the theory, I know how to do that, but the hic is ... There are
about 30 000 members.
So I get different kind of errors everytime I try something.
Like 500 Internal Server Error,
or the page would load forever and actually not do everything,
or I would get "Fatal error: Allowed memory size of 8388608 bytes
exhausted at (null):0 (tried to allocate 129 bytes)" ...

I tried both my sending multiple mail() functions in a loop (the way i
prefer), and only one mail() function with the whole coma-separated
list of emails.

Is there an easy way to send massive email?


I use this class for years that has been optimized for bulk delivery.
Currently I use it to send newsletters and alert messages to about
100.000 active site subscribers every day.

It lets you compose send personalized bulk mail with both HTML and plain
text parts (do not send HTML only messages or else the messages may be
blocked and bounce).

You can even compose message bodies with Smarty templates and just
replace the template parameters to adjust the message for each
recipient. The class comes with one example on how to do that.

The class comes with a function SetBulkMail() function that hints the
class to optimize itself for bulk mailing campaigns.

The class has means to replace just parts of its body for each
recipient, so you do not have to rebuild the messages from scratch to
send it to the users. This is good not only because its faster, but also
because it preserves memory, which is one of your problems.

Anyway, keep in mind that mailings to many users last very long (read
possibly hours). You should override the PHP time limit using
set_time_limit(0);

You probably need to run the mailing script off the Web server, probably
from a script started from cron or equivalent scheduler in your OS.

http://www.phpclasses.org/mimemessage

You should be ready to handle a flood of bounces of addresses that
became invalid. Get ready to unsubscribe them. The outgoing and ingoing
messages may fill up your MTA queue for a while. Make sure you have
plenty of free disk space.

If you are starting with a list of unverified address, you are strongly
recommended to clean them up first. You may want to try this class first
to figure which addresses are permanently invalid:

http://www.phpclasses.org/emailvalidation
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #11
nasht wrote:
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 send an html formated message.
In the theory, I know how to do that, but the hic is ... There are
about 30 000 members.
So I get different kind of errors everytime I try something.
Like 500 Internal Server Error,
or the page would load forever and actually not do everything,
or I would get "Fatal error: Allowed memory size of 8388608 bytes
exhausted at (null):0 (tried to allocate 129 bytes)" ...
First of all, AFAIK, PHP's mail function is not indented to send
bulk mails. But, 30,000 is still less to be considered bulk. The
problem I guess with you is that your handling of data--you may need to
optimize your buffer and querying mechanism.

Queuing using some C code could speed up the process. Google to find
out such techniques.
Is there an easy way to send massive email?


AFAIK, there is no way to send "massive" emails freely; many
commercial subscription services are there, say for example LISTSERV

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #12
In article <1h********************************@4ax.com>, ne**@dsv1.co.uk
says...
On Fri, 17 Dec 2004 15:58:15 -0800, Michael Vilain
<vi****@spamcop.net> wrote:
The non-profit I'm working with wants to do this to it's members. I
said for them not to or they're loose their internet connection. I
checked with their ISP and unless the list is double opt-in validated,
service would terminated almost immediately. That was a wake-up call
for them.


One of work's customers was told this before they signed up to us.
Almost a year later, after spaming me (postmaster at their "ISP") they
have stated that they will ignore our T&C's and continue to use their
non-verified mailing list which they compiled in the years before
their contract with us. I would like to terminate their account now,
but I'm the only person they've spam'ed so far and they are friends
with the company directors :(
As an alternative, the ISP offered access to their mailing-list server
(majordomo) which is completely configurable. We created a list and you
have to send email to an address to request to be put on it. Then
confirm by replying a "Are you sure you want to do this?" email. It's a
simple matter to provide a button on the web site to "sign me up for
electronic notification" that sends the initial email.


I set that up for free for them (not Majordomo, which I've used for
internal lists, but a simpler script - mailman?) and they are still
unwilling to use it to validate their previously un-validated list. I
gave up :(


Just catching up on the group here but you might be interested.

If you are _so_ set on getting away from that spamming ISP.
Sign the directors email up to their list.
If the list is as bad as you say, they will get an inside view of the
situation and either agree with you or find another solution.
Jul 17 '05 #13

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

Similar topics

3
by: lawrence | last post by:
If you're doing extensive formatting of output from a database, then you can't ask for all of a type of entry ("SELECT * FROM mainContent") and print it to the screen. On the one hand, it is an...
4
by: Hallvard B Furuseth | last post by:
I have a program which starts by reading a lot of data into various dicts. When I moved a function to create one such dict from near the beginning of the program to a later time, that function...
1
by: | last post by:
Hi- I was curious if anyone has had good luck using one of the commercial .NET FTP client libraries to perform massive LIST commands. I have tried various free libraries with no/little success,...
78
by: Robert Baer | last post by:
The homepage i have had up and seemingly working is: http://oil4lessllc.com/ However, the validator has so many complaints, and being so incompetent, i have no clue as to how to fix it all. Would...
15
by: jools | last post by:
I'm having trouble modifying some code written by someone else. The code is very dense and obscure but does work fine. However I need to insert a block of my own and I've hit what I assume is a...
7
by: Ming | last post by:
For example, 100,000 records, each record has 10 fields and may belong to one or more categories. How shall I save those records in DB? I think it is a very typical concern for most online shopping...
2
by: Sjoerd Mullender | last post by:
On 2008-04-21 08:01, Brian Vanderburg II wrote: That is just mailman (the mailing list software) keeping track of things. If there were a bounce, mailman can determine from the address of the...
4
by: stefano.troiani | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.