Web Design Forum: Sending Emails to all members - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Sending Emails to all members Rate Topic: -----

#1 User is online   adamsmith 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 336
  • Joined: 04-June 11
  • Reputation: 9
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 23 January 2012 - 02:35 PM

I was wondering how the best way to do this would be...

Would you do it by having an admin account on the website where you can write the email and send from the admin account or is there a better way of doing it?

Thanks
0

#2 User is offline   web-itec 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 533
  • Joined: 23-March 11
  • Reputation: 53
  • Gender:Male
  • Location:United Kingdom
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 25 January 2012 - 03:32 PM

View Postadamsmith, on 23 January 2012 - 02:35 PM, said:

I was wondering how the best way to do this would be...

Would you do it by having an admin account on the website where you can write the email and send from the admin account or is there a better way of doing it?

Thanks


if your talking about having a database of users and there emails then the best way to do it would be by the while loop like

 $message = "Message you are sending";

 $result = $db->select("accounts","*","`accounttype`='2'",""); //db query 
 while ($row = mysqli_fetch_assoc($result)) {
  $email = $row['email'];

   $mailer->mail("$email", "$message"); /* whatever your mailer class is */
 }


that would send a message to all the users whos accounttype is equal to 2,
obviously just that wouldnt work because you need the classes etc but it gives you a good idea
0

#3 User is online   Renaissance-Design 

  • Available for custom WordPress work
  • View blog
  • Group: Moderators
  • Posts: 3,595
  • Joined: 12-August 10
  • Reputation: 559
  • Gender:Male
  • Location:South Wales
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 25 January 2012 - 03:51 PM

I suggest a cron job that sends batches of 50 per 30 minutes, if you're talking about a large number of users.
0

#4 User is online   Sogo7 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 421
  • Joined: 02-February 11
  • Reputation: 42
  • Gender:Male
  • Location:Camarthen
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 25 January 2012 - 05:31 PM

I don't do a lot of bulk emailing myself but this kind of question crops up quite a bit down in the lower levels of free web hosting where the rules are a lot more draconian.

Batching is essential and do find out exactly what your hosts mail sending policy actually is, because there will be a catch in there. A typical example of this is Hostgator, the big print reads 500 emails per hour, (oh goody 24hrs x 500 = 12000). However the small print says any mailing list with over 900 recipients has to be sent 'off peak' and any list over 5000 (as one list or several smaller together) and they will be tapping your credit card for a dedicated server or VPS upgrade.

SMTP via Gmail & Google Apps
will enable emails from somebody@mydomain.com to be sent using the Google mail servers but again there is limit of 500 per day (roughly 8 a minute) for a single account. If I recall you can boost this figure by enabling billing for the app engine, this raises the free quota threshold and lets you send 2000/ day without being charged.
0

#5 User is online   adamsmith 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 336
  • Joined: 04-June 11
  • Reputation: 9
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 25 January 2012 - 06:59 PM

I never knew any of that, I just assumed it was free and you could send as many as you wanted... I'll look into that.

I'm gonna check out cron job too, how would you guys personally do it, would you use a cron job or would you just have an admin page where you can write an email and send to all users?
0

#6 User is offline   AdvantageDigitalMedia 

  • Forum Newcomer
  • Group: Gold Membership
  • Posts: 21
  • Joined: 31-January 12
  • Reputation: 1

Posted 31 January 2012 - 09:44 PM

View Postadamsmith, on 25 January 2012 - 06:59 PM, said:

I never knew any of that, I just assumed it was free and you could send as many as you wanted... I'll look into that.

I'm gonna check out cron job too, how would you guys personally do it, would you use a cron job or would you just have an admin page where you can write an email and send to all users?


Again, as said above, that's not really a question that can be answered without knowing the amount of e-mails your sending. If you have 5 users and it won't increase then fine, but if it's a newsletter with 2000 subscribers you're going to need to batch the sending. A cron job would work, or use the sleep function within PHP and a while loop to achieve a similar thing to prevent it throttling the server.

Cheers
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users