By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,500 Members | 2,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,500 IT Pros & Developers. It's quick & easy.

massive email

P: n/a
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
Share this Question
Share on Google+
12 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.