I’m not sure that this is a good idea, email is just not a good medium for emergency messages (who will see the email when you are a sleep or at the beach?), and if you want to monitor the site it is better done by external service which will probably be able to send you an SMS or make a phone call.
That being said, if you want to still send emails, you need to store the last error time in a separate file, and before sending a mail read the file and check when was the last time a mail was sent. The important detail here is that the file need to be writable by the web server. It is probably a good idea to locate it outside of the web root on your server.
Related Posts:
- Get error messages when $wpdb->insert() returns false?
- Detecting errors generated by $wpdb->get_results()
- $wpdb->prepare() warning in WordPress 3.5
- Changing the Database Connection Error Message
- When importing database, it shows error
- Strange Deadlock database error for the query “Delete From wp_options”
- WordPress showing install screen after max_questions error
- What causes the “max_user_connections” warning on WordPress frontend?
- $wpdb variable throw this error Call to a member function get_results() on a non-object in
- Error establishing a database connection – with Debug Data
- error establishing a database connection
- Error: SELECT SQL_CALC_FOUND_ROWS
- Error establishing a database connection on Installation
- SQL Error wp_commentmeta – incorrect table definition
- Moving WP from local server to live, error establishing a db connection
- Where are WP_Errors Saved
- $wpdb doesn’t like to store arrays
- Error establishing database connection – high traffic?
- Catalina an MAMP Database Conenction Error
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- How to fix database error duplicate entry
- Moving to another server database connection error [closed]
- “Error establishing a database connection” – Intermittent error on GoDaddy
- Problem in using wpdb
- Global__r connection timed out
- SELECT SQL_CALC_FOUND_ROWS with wordpress search
- Error establishing a database connection in wordpress site , website not opening
- How to get the full stack trace for WordPress “table doesn’t exist” error in debug.log?
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- SQL database import #1046 error
- error establishing a database connection 3
- “wordpress error in establishing database connection” and missing tables
- error establishing database connection (WAMP + filezilla)
- Hang Up Followed By Can’t select database
- Database error after importing WordPress
- Catchable fatal error in formatting.php
- What am I doing wrong here? WordPress database error
- Simple email input store in database
- Restoring .sql backup results in “Error establishing a database connection”
- I broke database after reuploading local version – what exactly happened? Database error
- Print output of Table Creation
- Error at time of WordPress Installation
- WordPress database error Unknown column
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- Is it fine to have foreign key as primary key?
- Custom form that store input in database
- Restoring WordPress posts from database only
- Performance Gains of Relational DB Setup
- store simple data in get_option()
- What are conventions about the schema of the $table_prefix
- BuddyPress: What’s the use of wp_bp_xprofile_data table and how does it get updated? [closed]
- storing database in version control
- Is deleting orphaned wp_options entries safe?
- How to build a movie database with wordpress?
- Sub-domain or 2nd, temporary different domain?
- How do i get user data from a custom table in the wordpress database by user ID?
- Converting WordPress into Android or iPhone app
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Database slowdown after update to 3.4.1
- WooCommerce sku location in DB
- How to insert data into MySQL database from the form created in WordPress site
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- Emoji support and MariaDB 10.0.30-
- Can I have multiple database users within WordPress?
- Modify Database in Multi-Site wp_usermeta table
- Connect to a remote database for wordpress in my own hosting server
- WordPress ‘repairing database’ in a constant error loop?
- What Is the Proper Way to Merge Usermeta Table to a an existing WP Database?
- Importing CSV into database table not working?
- What do these phpMyAdmin errors mean on my WordPress databaes?
- Check if an option exists and get its value in one hit
- Problems with moving my WordPress site to another domain/server
- Is it important to have integers inserted using %d rather than %s?
- Export a custom Mysql database product catalog to WordPress
- Which table (and column) has the content of configured get_post_meta?
- Serialize data before inserting into the DB
- Reinstalling wordpress from database breaks the site
- Pages from custom table
- Trouble running $wpdb->query() with last_insert_id
- Can I customised default WP table
- Woocommerce – Check product stock availability from external database
- WordPress where clauses in db select
- How to display data from db in select list [closed]
- Will adding & modifying default WordPress table index break future WordPress update
- Database migration issues – Error #1046 No database selected
- echo site_url() returns a different value than what is in the database siteurl field
- Native timestamp on wp_options option
- SELECT rows between two datetimes when the range is dynamic [closed]
- How to access a table in a wordpress database using REST API?
- Correct and secure way to access a custom SQL database in a custom PHP template file
- Does WordPress Support Using Named Pipes on the Windows Operating System?
- Missing latest posts and options after DB migration via phpMyAdmin
- Custom metabox does not store data
- How do i get value from wp_postmeta?
- Local host to server import problem
- featured image not showing up with mysql_connect
- Getting deleted users in database
- Options of accessing wordpress data from mobile app
- Getting data from a table using a query
- Database interaction (private-public) [closed]