Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Mailing List

Featured Replies

Hello,

 

Im sure you have answered this question many times but here goes, I want to add a subscribe feature to my blog, so when something new gets posted, Anyone who is subscribed to my list will recieve an email, but how would i email all the users effectivly, Would i use a foreach loop?

 

foreach($emails AS $email) {
mail($email... and so on..
}

 

Is this the correct way to do it?

Hello,

 

Im sure you have answered this question many times but here goes, I want to add a subscribe feature to my blog, so when something new gets posted, Anyone who is subscribed to my list will recieve an email, but how would i email all the users effectivly, Would i use a foreach loop?

 

foreach($emails AS $email) {
mail($email... and so on..
}

 

Is this the correct way to do it?

 

Yes this will email all subscribers in ur database :)

Hello,

 

Im sure you have answered this question many times but here goes, I want to add a subscribe feature to my blog, so when something new gets posted, Anyone who is subscribed to my list will recieve an email, but how would i email all the users effectivly, Would i use a foreach loop?

 

foreach($emails AS $email) {
mail($email... and so on..
}

 

Is this the correct way to do it?

Well scratch that actually it should work but the best way prob would be

while($row= mysql_fetch_array($query)) {
    $email = $row['email'];
    $message = $row['message'];
$subject = $row['subject'];
mail($email,$subject,$message,$headers); 
}

If your database of subscribers is 500 or 1000 and your email code just selects all of them to send at the same time, your hosting service or ISP may block them. Somehow you probably need to set a limit, say 30, which is fairly easy to do in PHP but then how do you set up the next sequence? I don't know.

 

Also you may need another field in your database to deselect some of them, perhaps those who haven't visited your blog for over a year or any other reason you can think of.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.