Why WordPress emails go missing
By default, wp_mail() uses PHP's mail() function, which sends through your hosting provider's mail server — usually unauthenticated and often already on a blocklist because it's shared across thousands of sites. Routing through a real SMTP relay fixes this immediately.
Option 1: A plugin (easiest)
Install a plugin like WP Mail SMTP or Post SMTP, then under its settings choose "Other SMTP" and enter:
| Field | Value |
|---|---|
| SMTP Host | smtp.sendcorex.com |
| Encryption | TLS |
| SMTP Port | 587 |
| Username | Your Sendcorex API key |
| Password | Your Sendcorex API key |
Send a test email from the plugin's settings page before relying on it for real traffic.
Option 2: Code, via functions.php
If you'd rather not add a plugin, hook into phpmailer_init:
add_action('phpmailer_init', function ($phpmailer) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.sendcorex.com';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->SMTPSecure = 'tls';
$phpmailer->Username = getenv('SENDCOREX_API_KEY');
$phpmailer->Password = getenv('SENDCOREX_API_KEY');
$phpmailer->setFrom('hello@yourdomain.com', get_bloginfo('name'));
});
Verify your domain, not just the SMTP credentials
Either method only helps if the sending domain has SPF, DKIM and DMARC published — otherwise you've swapped one unauthenticated sender for another.