It has probably more systematical solution, but one option is to save the highest recipient ID, and then load only higher IDs next time. Something like this: (not tested)
$last_id = get_option('last_recipient_id');
$rcvr_id = $wpdb->get_results( $wpdb->prepare("SELECT ID FROM wp_users WHERE ID > %d ORDER BY ID "), $last_id ) ;
foreach($rcvr_id as $rv_id) {
$rcvr_id = $rv_id->ID;
// your actions
//...
} // end of foreach
// if some result was loaded, $rcvr_id holds the last ID value
if( $rcvr_id )
update_option( 'last_recipient_id' , $rcvr_id );
Related Posts:
- SMTP connect() failed PHPmailer – PHP
- Send Custom Post Notification to Followers
- How can I send an email using PHP?
- How to validate an email address in PHP
- What is the difference between ports 465 and 587?
- Send email with PHP from html form on submit with the same script
- Email validation in Ruby on Rails?
- PHP mail function doesn’t complete sending of e-mail
- Is there a way to embed an iframe in an email with text that updates?
- PhpMailer SMTP NOTICE: EOF caught while checking if connected
- PhpMailer SMTP NOTICE: EOF caught while checking if connected
- PHP mail: Multiple recipients?
- Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
- How to set SMTP programmatically
- Disable email notification after change of password
- changing notification emails from WordPress @mydomain.net to something else
- Disable user registration password email
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- Alert Email when any Post or Page is Changed
- Do something after sending email
- How do I customise the new user welcome email
- How do you update user_email on the front end in WP 3.3?
- Missing URL in password reset email
- User Without Email?
- “Reply-to Address” Email
- prevent users from changing their email address
- Disable new user notification to admin email
- Allow Duplicate Email Address for Different Users
- How do I override the Message-ID header of wp_mail function?
- Email confirmation on registration
- Customizing lost password email
- Remove admin bar for subscribers
- Create custom welcome email without a plugin
- Include HTML template file in wp_mail
- Email sent from WordPress has HTML tags
- How to disable automated E-Mail on PHP error/exception?
- Reset Password – change from name and email address
- How do i send mail with custom Form Data using WordPress
- Email as Username in registration
- Email stats at Ma.tt contact form
- Fwd: [Website Name] Notice of Email Change [closed]
- Send all WPMU emails via SMTP
- Send mail to wordpress admin
- How to disable wordpress confirmation email for new users
- Send a confirmation of user role upgrade conditionally
- WP Cron emails not working
- Dynamically send pdf attached to post with contact form 7 [closed]
- Few chars getting replaced with ‘=’ in mail content in wp_mail()
- Locked out of my own blog and password reset not working
- wp_mail recipient array not sending?
- Change Password notification text on mail
- Transferring contact form input to an email account without using an email-proxy
- Should I use the standard wp_mail() function for a premium theme?
- On form submission how to send 2 email to different users
- How to Configure SMTP on wordpress Cant Send Email
- email wordpress users using BCC
- Best way to create a user programatically
- Contact Form 7 + Configure SMTP: Sender email appearing as my own email [closed]
- email sends from [email protected] even though I have it set to something else
- Should I use wp_mail or PHP’s mail? [duplicate]
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- Mail not sent when I set HTML headers
- Handle registrations in WordPress when user doesn’t have any email?
- Joining confirmation email
- How to sent one form values to 2 different sites in wordpress
- How to setup SMTP for only one specific wp_mail()
- Send PDF link in email based on radio button selection
- apostrophe in email name
- Sanitizing and validating email field
- Disable WP notifications for commenting on own posts
- General Setting Allow Multiple Email Notification
- Must I change the admin user email address while changing the general email address?
- User invite email not delivered – related to subdomain?
- Woocommerce HTML email option unavailable
- Can I configure WordPress to use postfix without a plugin?
- woocommerce and is_user_logged_in() if not redirect to homepage
- Ability to download only after email supplied [closed]
- Batch Emails with wp_mail()
- Email notification after registration in WordPress
- Subscribe from another website to the same list [closed]
- Trigger Woocommerce New User Email
- Processing a subscription form with POST method?
- Obfuscating Email Addresses in Form Fields
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- Email ‘from address’ has a www in it
- How to validate website field in contact form 7?
- How to Change WooCommerce new order email?
- Trigger WordPress Actions from Email?
- WordPress E-mail Config
- Is there no way to send email using SMTP without plugin or custom coding?
- How to change WordPress email notification sender?
- Contact form sender email
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- PHP mail() works but wp_mail() does not
- Sending email from inside a plugin using PHP PEAR
- Send email daily from WordPress site
- WordPress Add New User – Send an Activation Email
- Send email only upon draft
- Mechanism to send to users of secured WordPress install new notifications by SMS or email?
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce