tags:

views:

291

answers:

6

Hi there, I'm about ready to unveil a "coming soon" page and one thing I need is a way for users to enter their email address for me to email once the site goes live. What is the best way to do this?

Should I store the emails in a DB and then run a PHP script to email them from my web host? Should I have the emails just kind of be collected and then emailed manually by me either locally or from the server? Is there another way I should do it?

Also, are there certain web-hosts that restrain the amount of emails you can send out, thus causing a problem for mass email.

The only "unknown" currently is how large of a response I'll get...only time will tell.

Thanks guys!

A: 

Writing the emails to a database or a text/log file are both fine ways to store the emails.

Depending on how many emails you receive, you may want to write a program (PHP works) to send a separate email to each person. Don't send a mass email from your regular email client with everyone on a big To: line.

There are also commercial programs that manage mailing to lists of people (probably open source ones, too). Most of those commercial ones offer a free trial period.

Eric J.
A: 

Store the email addresses in a database and write a batch job that mail merges them into your message and sends them out as needed.

duffymo
+1  A: 

Like Eric mentioned above, another option is to use a commercial service to manage your mailing list.

I use Mailchimp (http://www.mailchimp.com). They give you everything you need (signup forms, email templates, etc.), and are completely free unless your list grows to more than 500 subscribers.

Bo
+1  A: 

There are dozens of methods you can use for this kind of problem, but unfortunately there's no real way to pinpoint a solution for you, since there are a lot of variables.

If you only get 3 responses, then you might want to just manually email the users from your email client using BCC:. You've already got all the tools you need to do that, and setting up a script might be a waste of time. This isn't really a great long-term solution however.

For most moderate-sized web sites you would store the emails in a database, and use a mailing script to send them out. PHPMailer is a good tool to help with getting mail sent, and you can manage a decent amount of email addresses manually. Managing addresses manually can be a bit of a pain however, as you have to deal with unsubscribe links, script timeouts, bounced email, etc.

If you get up the tens of thousands of email addresses, you may want to start looking at a third-party mailing software or service that can do threaded sending. Looping through and sending email to 50,000 people via a PHP script can be slow, and take hours.

Basically you have to weigh the difficulty, time and cost of each method versus how much flexibility and power you think you're going to need.

zombat
+1  A: 

To store emails in a db, and sending them out using a cronjob is a good way to solve the problem, if you have constrains regarding the amount of emails you're allowed to send within a period of time, you can handle it by keeping track of how many emails you've sent every time the cronjob runs. Also, there are open source products to do this, such as phplist http://www.phplist.com/

gmaurol
+1  A: 

Store it in the database - Yes. It's no unlike storing any other piece of data.

Mass email at once - No

Mass email manually (or individually mail manually) - No

Do some web hosts limit how many you can send at once? - Yes

I don't know the "best" way but I know a really good way. We have built several mass emailing programs and the technique we incorporated was a throttling technique whereby we had a script that ran every three minutes and sent 20 emails at a time.

It keeps the server from choking and the mail queue from exceeding any of our hosts' mail limits.

jerebear