We help IT Professionals succeed at work.

Sending 150,000 emails, optmization and statistics

manojoswal
manojoswal asked
on
342 Views
Last Modified: 2006-11-17
We are working a global media company  who wishes to send a hundred thousand emails each month to is sunscribers.
I beleive the number of subscribers would be in the range of 150,000. They need these mails to reach within a specific time
length. (like few hours before their official movie launch etc) .

One :
I need to know if this would be faster over a mail server using php/mysql on our windows 2000 server in the data center
or would it be faster using mail client software like the ones at www.mailutilities.com 

Two:
The server is a Windows 2000 server with 1 gig of RAM and 2.4 GHZ processor. How many mails per hour would such a machine fire approximately.

Three :
Is there any optimisatoin possible?. The emails are same message to all, no personalisation. If yes can some one write here the method/code to optmise the sending of emails in bulk.

Regards

Manoj Oswal

Comment
Watch Question

I don't know how you could do any optimizations:  you would basically be sending the mails out to everybody using a loop.  I don't know you could get past that.  Sending out that many mails shouldn't tax your server that much.

Commented:
One: Probably not much difference, although I think PHP would be faster.

Two: Server is fine depending on what other applications are loading it up. Your bandwidth is going to be the limiting factor. (eg a 56k dial-up is a lot slower than a T1)

Three: No, except that if correctly coded in a loop it should run as quick as the server can process it. (which should be pretty fast with that machine) It will probably quicker if you are running your own smtp server on Windows 2000.

Basically:

Get email addresses from Database;
for each mail address;
      put email address into mail header;
     add mail text to be sent;
     send using PHP mail() function;
loop for each;
done

Author

Commented:
how many mails shoud i be able to fire each hour? i have a 10 MBPS burstable connection with my datacenter
Is that 10 megabytes or 10 megabits?  Are you only sending text messages or will have any HTML?  If it's 10 megabytes per second, I bet you could send those emails out in well under half an hour.  Again, I don't think you can do any optimizations.  A loop is a loop.
gr8gonzoConsultant
CERTIFIED EXPERT

Commented:
There is one possible optimization that could improve speeds in some scenarios. To explain, look at this sample list of addresses:

bill@hotmail.com
bob@mailserver2.com
joe@hotmail.com
mary@hotmail.com
frank@mailserver3.com

There's a few free e-mail providers like hotmail and yahoo that will show up frequently on your mailing list. On a list of 150,000 people, you might have 50,000 or more hotmail/yahoo/msn/etc addresses. If you just loop through each address and use the mail() function, each time you send an e-mail, it will open up a connection to your mail server and send the message to the queue to be processed later.

What you CAN do instead is split your mailing list into two parts:
1) Standard addresses.
2) Common, free addresses like Hotmail, Yahoo, MSN, etc... (You can run a report on your mailing list to find the common domain names)

Then, have one script run the standard mail() function for List #1, while another script takes List #2 and runs an optimized SMTP session for each domain name.

What I mean by this is you sort the second list by domain names, and then for each domain name, you open up 1 SMTP session, and send out the e-mail to every address for that domain, then you go to the next domain name and do the same thing.

So for example, you'd open up a socket to Hotmail's mail server, send the message to all of your @hotmail.com addresses and close the socket. Then you'd go on to Yahoo, open up the socket, send the message to all of your @yahoo.com addresses and close the socket, and repeat for each major domain name.

The advantage to this is that you're doing some of the grunt work for your mail server - instead of just giving your mail server more messages to send out, the second script is doing all the delivery work, so it's almost like having two mail servers running.

Of course, this adds a certain amount of complexity, since you have to build your own custom SMTP function (which isn't too hard - there are plenty of examples out there), but it would add a nice performance boost. Here's a simple description of how to create your own custom SMTP session:

https://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20882659.html

Another option would be to use a second mail server, if you have one. If you don't have one and are short on funds, you may want to look into Ev1servers.net's inexpensive dedicated servers:

http://www.ev1servers.net/english/index.asp

You have both Windows and Linux solutions there. Linux would arguably be faster in handling mail (depending on what mail service you set up), but Windows would probably do well, too (the Windows servers are cheaper, too).

- Jonathan
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Thanks for the points, but you give gr8gonzo points as well:  his solution does seem as though it will work.  He obviously put a lot of effor into his answer.  Why don't you try out his solution?

Author

Commented:
The points were meant for gr8gonzo/ i have written support about the mistake, i acually clicked on your link instead of his, relaised this only when i saw the green make before your name. of course gr8gonzo has taken a lot of efforts on it and deserves full marks.
gr8gonzoConsultant
CERTIFIED EXPERT

Commented:
Thanks!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.