WEB WORKBENCH

My Project Workspace

A collection of systems, experiments, and builds

Simple WordPress Email Test Plugin (SMTP Debug Tool)

I built a very small WordPress plugin to quickly test whether SMTP and outgoing email is working correctly on a WordPress site.

Ideal for a new wordpress build especially if self-hosting.

It’s designed as a lightweight diagnostic tool — nothing more.

What it does

This plugin adds a simple User Interface inside WordPress:

Tools → Email Test

From there you can:

• Enter an email address
• Send a test email from WordPress
• Receive instant success/failure feedback

It uses WordPress’s built-in wp_mail() function, so it reflects your real server/email configuration.

Why I built it

When working with hosting setups, email delivery is often one of the first things that breaks or needs checking.

This tool helps quickly confirm:

• PHP mail is working
• SMTP configuration is correct
• WordPress can send outbound emails

Plugin code

Click to view source code ↓
Full source code for the Simple Email Test plugin.
<?php
/*
Plugin Name: Simple Email Test
Plugin URI: https://webworkbench.co.uk
Description: A simple plugin to send test emails from WordPress.
Version: 1.0
Author: Tudor Gibson
License: GPL2
*/

if (!defined('ABSPATH')) {
    exit;
}

add_action('admin_menu', 'set_add_admin_menu');

function set_add_admin_menu() {
    add_management_page(
        'Email Test',
        'Email Test',
        'manage_options',
        'simple-email-test',
        'set_email_test_page'
    );
}

function set_email_test_page() {

    $message = '';

    if (
        isset($_POST['set_send_email']) &&
        check_admin_referer('set_email_test_nonce')
    ) {

        $email = sanitize_email($_POST['set_test_email']);

        if (is_email($email)) {

            $subject = 'WordPress Email Test';
            $body = 'Congratulations! Your WordPress email system is working correctly.';
            $headers = array('Content-Type: text/plain; charset=UTF-8');

            if (wp_mail($email, $subject, $body, $headers)) {
                $message = 'Email sent successfully to ' . esc_html($email) . '.';
            } else {
                $message = 'Email failed to send.';
            }
        } else {
            $message = 'Please enter a valid email address.';
        }
    }

    echo '';
    echo 'Email Test';

    echo $message;

    echo '';
    wp_nonce_field('set_email_test_nonce');

    echo '';
    echo '';
    echo 'Email Address';
    echo '';
    echo '';
    echo '';

    submit_button('Send Test Email', 'primary', 'set_send_email');

    echo '';
    echo '';
}
      

Important note

This plugin is provided as a simple utility tool for testing WordPress email functionality.

I do not provide support for installation or configuration on external systems or third-party hosting environments.

It is intended for:

• Developers
• Test environments
• WordPress administrators familiar with backend tools

Download

A downloadable ZIP version of this plugin is available on the website.


Download Simple Email Test Plugin

Notes

This tool is part of my Web Workbench system — a collection of small, practical utilities built to solve real hosting and WordPress problems quickly.

Found This Useful?

If you found this useful, please consider sharing it.

InfoAbout Cookie infoContactFAQs