Using pages plugin mailchannels giving error
I'm trying to use the pages plugin mailchannels to make use of a form on my website and get the responses emailed to me however when submitting the form, I get this error.
10 Replies
Try setting up Domain Lockdown with the DNS rule - https://support.mailchannels.com/hc/en-us/articles/16918954360845-Secure-your-domain-name-against-spoofing-with-Domain-Lockdown-
I'm also trying to get this working atm... I receive the same error
lmk if you make any progress because I'm pretty stumped. I sent an email to support, will update if I figure anything out
Same it works on my other website so not sure why it doesn't work on this one
It's the same code
I set copied that same function, changed the
from
part of it to my own domain, and set this DNS record but see the same as you. Not sure what else to trysame, i just gave up and switched to another form service
I have the same issue with mailchannels, have even added DKIM, anyone found a solution?
Make sure you have whitelisted your pages.dev, your functions will always count as executing on the pages.dev itself, even if you are using a custom domain, ex you want a record like:
_mailchannels TXT v=mc1 cfid=xxxxx.pages.dev
where xxxx is your pages project.dev, like
_mailchannels TXT v=mc1 cfid=quick-test.pages.dev
cc @chriskealley
Mailchannels lockdown ref: https://community.cloudflare.com/t/introducing-mailchannels-domain-lockdown/523913
@chriskealley in our error message, you will find your cfid.
Feel free to PM me with your cfid and I'll check our logs.
yea, sadly it looks like the mailchannels pages plugin does not pass the error or anything other then a generic failed, not on you of course but it makes it more confusing for them. It was made before lockdown
The language on https://support.mailchannels.com/hc/en-us/articles/16918954360845-Secure-your-domain-name-against-spoofing-with-Domain-Lockdown- is a bit confusing as well, it's not always the workers.dev subdomain as the article says it is
If it was a worker executed via its worker.dev url, then it would be their worker.dev.
If it was a worker on a custom domain, then the custom domain zone would be right. That is, a worker running on worker.mydomain.com, where mydomain.com was the zone/website added, would have the cfid of mydomain.com
Pages is special, and all Pages Functions, regardless if executed on the pages.dev or via a custom domain, have the cfid of the pages.dev, like xxx.pages.dev.
So I have got it working, If you are using a pages build, you need to add your pages.dev domain that your cloudflare project is created as to the CFID as @chaika.me & @ttul hinted above.
Eg, if you pages project has the domain -
Eg, if you pages project has the domain -
my-pages-site.pages.dev
, add that to the TXT record _mailchannels TXT v=mc1 cfid=my-pages-site.pages.dev
FYI I am not sure if this is needed but I also have the workers.dev record in the TXT record too.Ah alright thanks