Mass Email

This is a discussion on "Mass Email" within the PHP Forum section. This forum, and the thread "Mass Email are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 26th, 2008, 00:40
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Mass Email

Hi,

I know how to send email (using PHP), I'm just wondering if it's a good idea to have a ton of people under Bcc (Cc or To would be stupid for obvious reasons). There's no problem with that, is there? I don't need some bloated software that manages lists for me and what not. The only advantage I can see of using some mass-email software is that it might allow you to customize each message (like put include the user's name in the message, "Hello darkzerox, [...]" whereas with a big Bcc list, you can't do that.

And before anyone starts the spam debate, I'm writing this for a client who just wants to send a few messgaes to his opt-in members.

Thanks for any tips.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 26th, 2008, 02:44
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,266
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Mass Email

I wouldn't do BCC. If you get too many addresses in there, the mailer daemon will start cutting of recipients, and you won't be able to tell. Plus I think some mail clients will show the rest of the BCC addresses if your one of them.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 26th, 2008, 02:48
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

Ahh... okay then. Well then, I'm inserting all the user data with emails into a MySQL database. Any way I can pull the emails from there and use them in some web-based mailer? What might you recommend?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 26th, 2008, 02:50
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,266
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Mass Email

PHP's mail() function would work pretty well
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 26th, 2008, 03:08
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

Quote:
Originally Posted by CloudedVision View Post
PHP's mail() function would work pretty well
Well, yes... that's what I was going to use, but then where would I put the emails? You said it might be a bad idea to put them all in Bcc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 26th, 2008, 03:21
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,266
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Mass Email

Loop it, sending an email independently to each person. Just be warn: if you go to long without outputting any text, the browser will get a timeout error, and sometimes scripts running for too long will be cancel by the server.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
The Following User Says Thank You to CloudedVision For This Useful Post:
  #7  
Old Jun 26th, 2008, 03:32
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

Yes, that was my concern. The only reason I didn't want to do that. But I don't think my client will get more than 500 subscribers, so I doubt it'll be a problem unless it's horrendously slow. I guess I'll cross that bridge when I get there, thanks for the tips.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 26th, 2008, 19:27
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,794
Thanks: 0
Thanked 17 Times in 17 Posts
Re: Mass Email

I too would use the mail function and loop through the DB. When doing this, you can also customize the output per recipient.

I would also watch if your hosting allows you to mass mail -last thing we would want you/your client is getting the account suspended by their host. Ready-made mass-mailers sometimes have an option to send emails out in batches of say 15 in over 5 mins (3 per min) which, if your host doesnt allow mass-mailing, will get around the problem - normally, anyway!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 28th, 2008, 17:05
frinkky's Avatar
Super Moderator
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 351
Blog Entries: 2
Thanks: 2
Thanked 6 Times in 6 Posts
Re: Mass Email

Couldn't you add in to the loop a function to display the contents of the email just sent, so you're always outputting text? It might slow the sending but you could leave it with a massive stack of emails to churn out overnight and presumably you could add in a random delay between emails - i.e. between 5 & 15 seconds, to get around the potential host disallowing mass mail issue?
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jul 1st, 2008, 21:54
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

Quote:
Originally Posted by frinkky View Post
Couldn't you add in to the loop a function to display the contents of the email just sent, so you're always outputting text? It might slow the sending but you could leave it with a massive stack of emails to churn out overnight and presumably you could add in a random delay between emails - i.e. between 5 & 15 seconds, to get around the potential host disallowing mass mail issue?
What would be the point of displaying the contents of the email just sent? They'll all be pretty much identical, except perhaps for a name change here and there if my client wants that. I don't think a delay in PHP would work -- it'll time out after 30 seconds, but I could get away with some tricky JavaScript or even some clever usage of the HTML meta refresh.

Thanks for the heads up Marc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jul 1st, 2008, 22:19
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,266
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Mass Email

Quote:
Originally Posted by darkzerox View Post
I don't think a delay in PHP would work -- it'll time out after 30 seconds, but I could get away with some tricky JavaScript or even some clever usage of the HTML meta refresh..
I would use some fancy AJAX. Request the mailer again and again - mailing 20 or so emails each time - using AJAX. Then you also get a lovely little progress bar.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jul 2nd, 2008, 05:13
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

I could also queue the emails up in a database, and create a cron job that knocks a few off every so often, no? That way you wouldn't need to keep the website open either? Make it completely server side. Not really familiar with cron, but I'm sure I can figure it out.

Oh, one thing though, PHP's mail() function isn't really working well at all on this server (ixwebhosting). I got it to send out one email, but it refuses to send any more. Well, I guess it's the smtp server that's refusing? The function isn't failing, and I'm sure the code is right since it worked once... and it isn't my mail client either, I tried a few different email addresses at different domains (and it's not sitting in Junk either). I tried PHPMailer and SwiftMailer too... tried hooking it up to send through my Gmail account, but that didn't work either...

Quote:
Uncaught Error of type [swift_connectionexception] with message [The SMTP connection failed to start [tls://smtp.gmail.com:587]: fsockopen returned Error Number 110 and Error String 'Connection timed out']
Getting a little frustrated. Does anyone know why it might only have sent one email? (not trying to do mass emails yet -- just repeated attempts sending one email).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jul 2nd, 2008, 05:39
frinkky's Avatar
Super Moderator
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 351
Blog Entries: 2
Thanks: 2
Thanked 6 Times in 6 Posts
Re: Mass Email

The entire point of displaying each email message was to output something to restart the timeout timer - just chucking ideas out. I'm not hugely familiar with the mail functions so possibly not a valid solution.
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jul 2nd, 2008, 14:00
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,266
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Mass Email

Quote:
Originally Posted by darkzerox View Post
Getting a little frustrated. Does anyone know why it might only have sent one email? (not trying to do mass emails yet -- just repeated attempts sending one email).
Ask your host
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
The Following User Says Thank You to CloudedVision For This Useful Post:
  #15  
Old Jul 2nd, 2008, 22:34
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

Thanks. I contacted them via chat but after waiting 30 minutes he just told me to create a ticket. Waiting for them now... I hope these guys know what they're doing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jul 2nd, 2008, 22:38
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,266
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Mass Email

Quote:
Originally Posted by darkzerox View Post
Thanks. I contacted them via chat but after waiting 30 minutes he just told me to create a ticket. Waiting for them now... I hope these guys know what they're doing.
Doesn't sound like it

Who's this infamous hosting company of yours anyways?
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Jul 2nd, 2008, 23:32
Junior Member
Join Date: Jun 2008
Location: Nowhere
Age: 21
Posts: 15
Thanks: 2
Thanked 1 Time in 1 Post
Re: Mass Email

ixwebhosting. I didn't choose them. I host my own sites on hostgator...I've been pretty happy with them thus far.

Anyway, it seems adding these headers helps:

Quote:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: my name <me@mydomain.com' . "\r\n";
I think the extra \r\n at the end might be what's fixing it. Although I tried both SwiftMailer and PHPMailer... you'd think they would be a little more robust than my tiny script, but so far I've only had luck with this.

Last edited by darkzerox; Jul 2nd, 2008 at 23:37. Reason: typo ftl
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
bulk, email, mass, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Tommyttt Databases 0 Mar 30th, 2008 17:00
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26