Can I use a Cloudflare Worker to forward emails based on the recipient address?

Responsive Ad Header

Question

Grade: Education Subject: Support
Can I use a Cloudflare Worker to forward emails based on the recipient address?
Asked by:
79 Viewed 79 Answers

Answer (79)

Best Answer
(325)
Yes, this is a common use case. You can create a Worker that intercepts incoming emails and, based on the `To` address, forwards the email to a different address or service. This is done using the `email.forward()` API within the Worker. You can implement complex routing logic based on regular expressions or other criteria.