DELVOK
← Back to Blog
Security Guide

WordPress Sending Spam Emails: Stopping PHPMailer Abuse & Clearing Blacklists

November 17, 2026·Delvok Security Team·3 min read

Receiving a notice from your web hosting provider stating that your account is "suspended for sending bulk unauthorized spam" is terrifying. Within hours, your domain gets added to global email blacklists like Spamhaus (SBL/XBL), SORBS, and Barracuda, causing all legitimate business emails from your company to bounce straight to spam.

How Did Hackers Hijack Your WordPress Email?

Hackers do not need your email password to send millions of spam messages from your server. Instead, they exploit one of two vectors:
1. Unprotected Form Endpoints: A contact form plugin (like an unconfigured Contact Form 7, WPForms, or Gravity Forms) without reCAPTCHA or rate limiting allows automated botnets to submit thousands of messages per minute, using your server as an open email relay.
2. Hidden PHP Mailer Webshells: A backdoor script uploaded into your /wp-content/uploads/ directory executes raw PHP mail() functions or instantiates WordPress's bundled PHPMailer class directly, completely bypassing WordPress administrative controls.

Immediate Emergency Steps

  1. Do Not Just Request Delisting from Spamhaus: If you submit a removal request while the rogue script is still executing, Spamhaus will immediately re-blacklist your IP with an aggravated severity rating, making future removal significantly harder.
  2. Halt Outbound Mail Immediately: Place a temporary transport freeze on your server's mail transfer agent (MTA) or disable the mail() function in your PHP configuration.
  3. Locate the Calling Script: Every outbound email generated by PHP writes the originating script path to the mail headers or system log.

Once the malicious script is eradicated, Delvok manages the formal delisting appeals across Spamhaus, Google Postmaster Tools, and Microsoft SNDS to restore your email deliverability. Request an emergency email rescue here.

What Delvok Does Differently

Every site we rescue is migrated to isolated container infrastructure: your own web root, database, and server process. 24/7 monitoring catches threats before they become problems. Forensic-grade remediation ensures nothing is left behind.

Get Protected