I can't receive mails or send mails over wordpress

Cloudflare doesn’t proxy email. I’m not sure why you’d get a 504 on a wordpress site for form submission if the rest of the site works.