#"Could not send your email. Please try again." with MailChannels Pages Plugin

6 messages · Page 1 of 1 (latest)

stoic lotus
#

I m trying to send emails from a form in a astro static site I m making but I couldn't find a way to make it work.

I followed the guide https://developers.cloudflare.com/pages/functions/plugins/mailchannels/#spf-support-for-mailchannels

Right now I m not using cloudflare email routing as I m using google workspace, but I suppose it should work anyway, correct?

Now when i try to send email from https://majestico.it/contact/ I get the error "Could not send your email. Please try again."

Am I missing something?

Is there a way to debug this problem and get a significant error?

Thanks

YourSitesName

Open Graph Description

The MailChannels Pages Plugin intercepts all form submissions made which have the data-static-form-name attribute set. Then, it emails these form …

#
import mailChannelsPlugin from "@cloudflare/pages-plugin-mailchannels";

export const onRequest: PagesFunction = (context) =>
    mailChannelsPlugin({
        personalizations: [
            {
                to: [{ name: "Giulio Zanchetta", email: "[email protected]" }],
                dkim_domain: "majestico.it",
                dkim_selector: "mailchannels",
                dkim_private_key: context.env.DKIM_PRIVATE_KEY,
            },
        ],
        from: {
            name: "Enquiry",
            email: "[email protected]",
        },
        respondWith: () =>
            new Response(null, {
                status: 302,
                headers: { Location: "/thank-you" },
            }),
    })(context);
drifting brook
#

You're mentioning https://majestico.it/contact/, and the record for majestico.it is pointing towards majestico-it.pages.dev.

Considering that set up, it seems to me like you're missing cfid=majestico-it.pages.dev in your MailChannels Domain Lockdown record.

stoic lotus
#

Thanks @drifting brook it was actually that

ripe folio
#

Hey there! So I am completely new to cloudflare and mailchannels. I read the documentations and watched some videos on workers. I configured my DNS records. I didn't see anything in the mailchannels documentation if I need to edit the wrangler.toml file and setting up routes. I am getting this error when I deployed my sample worker for the email.