#How to setup mailchannels integration on Cloudflare Pages app with a custom domain?

1 messages · Page 1 of 1 (latest)

pine hearth
#

I made it work on workers, nothing complicated there, but it doesn't seem to work with pages.
Mailchannels just returns Error: Mailchannels API rejected: Failed to send email: 550 5.7.1 This sender is not authorized to send from....
I've set up the _mailchannels TXT record like this v=mc1 cfid=namespace.workers.dev cfid=namespace2.workers.dev cfid=customdomain.com and it still does not work with the custom domain.

#

Am I missing something?

radiant blade
#

Have you tried adding the pages.dev domain as an allowed one?

ripe sail
#

this^ you need to add the projects pages.dev subdomain as the cfid, as that is where the function runs

pine hearth
#

gonna try that right now

#

That's why we need the dev community =) Thanks folks! It's such an easy solution but still I didn't think of it

grand maple
#

hi @pine hearth are you using MailChannels on production? have you experience any rate limit?

pine hearth
grand maple
manic ferry
#

would there be any other reason this error is getting thrown ?

manic ferry
#

my txt record is
v=mc1 cfid=project.pages.dev cfid=namespace.workers.dev cfid=customdomain.com cfid=sub.customdomain.com
and the error i get back is

POST https://project.pages.dev/api/contact - Ok @ 08/04/2024, 16:08:17
  (log) Email send status: 500
  (log) Email send response: {
  errors: [
    'Failed to send email: 550 5.7.1 This sender is not authorized to send from customdomain.com. See https://bit.ly/domain-lockdown. cfid=project.pages.dev'
  ]
}
manic ferry
#

no idea why or how but it started working

#

i thin the dns was cached and it was serving the previous record i set