Reliable email delivery with minimal setup

Send email in WordPress

Send transactional email from WordPress in minutes with Sidemail and built‑in wp_remote_post. No plugins, SMTP, or Composer required. Sidemail handles deliverability, domain authentication, and email templates so you can send reliably and fast.

Get startedRead API docs
Send a welcome email from WordPress
// functions.php — reusable Sidemail helper
function sidemail_send_email( $args ) {
    $api_key = defined( 'SIDEMAIL_API_KEY' ) ? SIDEMAIL_API_KEY : '';

    if ( empty( $api_key ) ) {
        return new WP_Error( 'missing_key', 'Sidemail API key is not defined.' );
    }

    $response = wp_remote_post( 'https://api.sidemail.io/v1/email/send', array(
        'headers' => array(
            'Authorization' => 'Bearer ' . $api_key,
            'Content-Type'  => 'application/json',
        ),
        'body'    => json_encode( $args ),
        'timeout' => 15,
    ) );

    if ( is_wp_error( $response ) ) {
        return $response;
    }

    $body = wp_remote_retrieve_body( $response );
    $code = wp_remote_retrieve_response_code( $response );

    if ( $code >= 400 ) {
        return new WP_Error( 'api_error', 'Sidemail API Error: ' . $body );
    }

    return json_decode( $body );
}

Quickstart: Send email in WordPress

Start sending emails from your WordPress site in three steps:

1

Store your API key

Add your Sidemail API key to wp-config.php:

// wp-config.php
define( 'SIDEMAIL_API_KEY', 'your-api-key-here' );
2

Create a helper function

Add a reusable sidemail_send_email function to your theme's functions.php. It uses WordPress's built‑in wp_remote_post — no plugins or Composer needed.

// functions.php
function sidemail_send_email( $args ) {
    $api_key = defined( 'SIDEMAIL_API_KEY' ) ? SIDEMAIL_API_KEY : '';

    if ( empty( $api_key ) ) {
        return new WP_Error( 'missing_key', 'Sidemail API key is not defined.' );
    }

    $response = wp_remote_post( 'https://api.sidemail.io/v1/email/send', array(
        'headers' => array(
            'Authorization' => 'Bearer ' . $api_key,
            'Content-Type'  => 'application/json',
        ),
        'body'    => json_encode( $args ),
        'timeout' => 15,
    ) );

    if ( is_wp_error( $response ) ) {
        return $response;
    }

    $body = wp_remote_retrieve_body( $response );
    $code = wp_remote_retrieve_response_code( $response );

    if ( $code >= 400 ) {
        return new WP_Error( 'api_error', 'Sidemail API Error: ' . $body );
    }

    return json_decode( $body );
}
3

Send email from a WordPress hook

Call sidemail_send_email from any action hook, shortcode, or custom endpoint. Pass the recipient, sender, and template or content. That's all.

// Send welcome email when a new user registers
add_action( 'user_register', function ( $user_id ) {
    $user = get_userdata( $user_id );

    sidemail_send_email( array(
        'toAddress'     => $user->user_email,
        'fromAddress'   => '[email protected]',
        'fromName'      => 'Your WordPress Site',
        'templateName'  => 'Welcome',
        'templateProps' => array(
            'username' => $user->user_login,
        ),
    ) );
} );

Key features & perks

Why Sidemail for WordPress emails

  • Quick WordPress email integration

    Send emails from WordPress hooks in under 30minutes. No plugins, no Composer, no SMTP – just a small helper function using WordPress's built‑in wp_remote_post.
  • Reliable email delivery

    Sidemail's solid infrastructure and careful sender vetting process ensure your emails consistently reach inboxes, not spam folders. Dependable delivery without the headache of managing your own email infrastructure.
  • Custom sending domain with DKIM & SPF

    Send from your own domain without complex DNS configuration. Sidemail automatically handles DKIM and SPF setup for you – two of the most critical factors for strong inbox delivery and sender reputation.
  • All‑in‑one email platform

    Sidemail covers everything in a single platform – transactional and marketing emails, newsletters, email automation, subscriber collection, and contact management. One tool to replace multiple WordPress email plugins.
  • Premade email templates & no‑code editor

    Sidemail comes with a library of battle‑tested email templates that look great in every inbox. Need something custom? The no‑code editor lets you create responsive templates from scratch without writing any HTML.
  • Fits native WordPress workflows

    Use Sidemail with native WordPress hooks, password resets, contact forms, and WooCommerce events. It drops into the workflows you already have, without plugin bloat or SMTP workarounds.

WordPress transactional email examples

With Sidemail, you can send any transactional email from WordPress. Here are a few examples with code:

// WordPress: Send a WooCommerce order confirmation email
add_action( 'woocommerce_order_status_completed',
    function ( $order_id ) {
        $order = wc_get_order( $order_id );

        sidemail_send_email( array(
            'toAddress'     => $order->get_billing_email(),
            'fromAddress'   => '[email protected]',
            'fromName'      => 'Your Store',
            'templateName'  => 'Order Confirmation',
            'templateProps' => array(
                'customerName' => $order->get_billing_first_name(),
                'orderNumber'  => (string) $order->get_order_number(),
                'total'        => $order->get_formatted_order_total(),
            ),
        ) );
    }
);

Order confirmation email

Send a receipt or order confirmation to your WooCommerce customer after a purchase.

  • For receipts and order confirmations, include key details like the order number, items, and total in the email.
  • Pass dynamic data via templateProps to populate Sidemail's receipt and invoice templates.
See receipt email template
// WordPress: Send a password reset email
add_filter( 'retrieve_password_message', 'my_custom_password_reset', 10, 4 );

function my_custom_password_reset( $message, $key, $user_login, $user_data ) {
	$reset_url = network_site_url(
		"wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ),
		'login'
	);

	sidemail_send_email( array(
		'toAddress'     => $user_data->user_email,
		'fromAddress'   => '[email protected]',
		'fromName'      => 'Your WordPress Site',
		'templateName'  => 'Password Reset',
		'templateProps' => array(
			'actionUrl' => $reset_url,
			'username'  => $user_login,
		),
	) );

	return false;
}

Password reset email

Replace WordPress's default reset message with a branded password reset email that includes a secure reset link.

  • Hook into retrieve_password_message to replace WordPress's default password reset email with your own branded version.
  • Pass the reset URL via templateProps and return false to stop WordPress from sending its default reset email.
See password reset email template
// WordPress: Schedule a welcome email for 1 hour from now
$scheduled = gmdate( 'c', time() + 3600 );

sidemail_send_email( array(
    'toAddress'     => '[email protected]',
    'fromAddress'   => '[email protected]',
    'fromName'      => 'Your WordPress Site',
    'templateName'  => 'Welcome',
    'scheduledAt'   => $scheduled,
) );

Welcome email with scheduled delivery

Schedule a welcome email to be sent later, for example one hour after registration.

  • Use the scheduledAt field with an ISO 8601 timestamp to control exactly when the email is sent.
  • Ideal for onboarding flows where you want to delay the first message until after the user has explored your site.
See welcome email template
// WordPress: Send a contact form submission email
function handle_contact_form_submission() {
    // ... validate nonce and fields ...
    $email   = sanitize_email( $_POST['email'] );
    $name    = sanitize_text_field( $_POST['name'] );
    $message = sanitize_textarea_field( $_POST['message'] );

    sidemail_send_email( array(
        'toAddress'     => '[email protected]',
        'fromAddress'   => '[email protected]',
        'fromName'      => 'Contact Form',
        'templateName'  => 'New Inquiry',
        'templateProps' => array(
            'replyTo' => $email,
            'name'    => $name,
            'message' => $message,
        ),
    ) );
}

Contact form submission email

Send a notification email when someone submits your WordPress contact form, and pass the submitted data straight into your Sidemail template.

  • Validate the nonce, sanitize submitted fields, and use Sidemail to notify your admin or support inbox.
  • Pass form values via templateProps to populate a template like New Inquirywith the visitor's name, email, and message.

Deliverability best practices

SPF, DKIM, and DMARC for transactional email

SPF and DKIM are authentication protocols that verify your emails are legitimately sent from your domain. And DMARC builds on both by instructing mail servers how to handle messages that fail those checks. Together, they are 3 critical factors for inbox delivery and sender reputation.

Sidemail automatically handles SPF, DKIM, and DMARC setup for you, so your WordPress site sends authenticated, best‑practice‑compliant emails right out of the box.

Sidemail dashboard – Reliable email delivery
Graphics
Sidemail dashboard – No-code email editor
Graphics

The simplest way to build emails

No‑code email editor & premade email templates

Sidemail's no‑code email editor is the quickest way to create responsive email templates that render correctly across every client and device. No HTML knowledge needed. Add your logo and brand colors, and you're ready to send.

Need to move faster? Sidemail includes a library of production‑ready templates for the most common use cases – password resets, welcome emails, receipts, and more. Build from scratch or customize a premade template — we guarantee your emails look great everywhere.

Learn more

Get started today

Ready to send transactional emails from your WordPress site? With Sidemail's API and premade templates, you can integrate in minutes and deliver emails reliably — no plugins required.

Start free trial

FAQs

How do I send email from WordPress without a plugin?

Use Sidemail's email API with WordPress's built‑in wp_remote_post. Store your API key in wp-config.php, add a small helper function to functions.php, and call it from any hook, shortcode, or custom endpoint. No plugins, no Composer, no SMTP configuration needed.

Does this replace wp_mail()?

Yes. Instead of using wp_mail() with an SMTP plugin, you call Sidemail's API directly. You get template support, scheduling, delivery tracking, and high deliverability out of the box — features wp_mail() doesn't provide natively.

How do I use email templates with WordPress?

In the Sidemail dashboard, pick a premade template or build one with the drag‑and‑drop editor. In your code, reference the template by templateName and pass dynamic data via templateProps. Sidemail merges the data and delivers a well‑formatted email. No need to build HTML from PHP.

Can I use Sidemail with WooCommerce?

Absolutely. Hook into WooCommerce actions like woocommerce_order_status_completed or woocommerce_new_order and call sidemail_send_email() with the order data. It works with any WordPress action hook, so any plugin that fires hooks can be integrated.

Can I send scheduled emails from WordPress?

Yes. Add a scheduledAt parameter with an ISO 8601 timestamp and Sidemail will deliver the email at exactly that time. This is handled server‑side by Sidemail, so you don't need WP-Cron or any task scheduler on your hosting.

How do I handle email errors in WordPress?

Check the response from wp_remote_post using is_wp_error() for transport failures, then inspect the decoded JSON body for Sidemail API errors. The response includes an HTTP status code, error type, and a human-readable message. Log errors using error_log() or a WordPress logging plugin.