Email Security
Stop phishing threats others miss
Cloudflare Email Security provides advanced, AI-driven protection against phishing, malware, business email compromise, and ransomware. It prevents these threats from reaching user inboxes and uses machine learning-based behavioral analysis to block targeted campaigns against your organization. Recognized as a Strong Performer in The Forrester Wave™: Email, Messaging, And Collaboration Security Solutions, Q2 2025.
High Phishing Detection Accuracy
Comprehensive Protection
Flexible and Adaptable
Email Security Top Email Security Use Cases
See real-world examples of Cloudflare Email Security
Preventing Ransomware and Malware Attacks
Protecting Against Targeted Phishing Attacks
Flexible Deployment for Diverse Environments
Achieving High-Efficacy Phishing Detection
Email Security Code Examples
Integrate Cloudflare Email Security into your applications using these code examples.
import requests
api_key = 'YOUR_API_KEY'email = 'example@example.com'
response = requests.get(f'https://api.cloudflare.com/client/v4/email-security/verify-sender', headers={'Authorization': f'Bearer {api_key}'})
if response.status_code == 200: print('Email sender verified')else: print('Email sender verification failed')curl -X POST \ https://api.cloudflare.com/client/v4/email-security/scan-email \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"email": {"subject": "Test Email", "body": "This is a test email"}}'const axios = require('axios');
const api_key = 'YOUR_API_KEY';const email = 'example@example.com';
axios .get(`https://api.cloudflare.com/client/v4/email-security/protect`, { headers: { Authorization: `Bearer ${api_key}`, }, }) .then((response) => { console.log('Email protected'); }) .catch((error) => { console.error('Email protection failed'); });import java.io.IOException;import java.util.logging.Level;import java.util.logging.Logger;
import okhttp3.MediaType;import okhttp3.OkHttpClient;import okhttp3.Request;import okhttp3.RequestBody;import okhttp3.Response;
public class BlockEmails { public static void main(String[] args) { String api_key = "YOUR_API_KEY"; String email = "example@example.com";
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.get("application/json; charset=utf-8"); RequestBody body = RequestBody.create(JSON, "{\"email\": {\"subject\": \"Test Email\", \"body\": \"This is a test email\"}}"); Request request = new Request.Builder() .url("https://api.cloudflare.com/client/v4/email-security/block-email") .post(body) .header("Authorization", "Bearer " + api_key) .build();
try { Response response = client.newCall(request).execute(); if (response.isSuccessful()) { System.out.println("Email blocked"); } else { System.out.println("Email blocking failed"); } } catch (IOException ex) { Logger.getLogger(BlockEmails.class.getName()).log(Level.SEVERE, null, ex); } }}
Powerful primitives, seamlessly integrated
Built on systems powering 20% of the Internet, Email Security runs on the same infrastructure Cloudflare uses to build Cloudflare. Enterprise-grade reliability, security, and performance are standard.
Build without boundaries
Join thousands of developers who've eliminated infrastructure complexity and deployed globally with Cloudflare. Start building for free — no credit card required.