DEV Community

Discussion on: Sending Email with Netlify Functions

Collapse
 
jeffwscott profile image
Jeff Scott

netlify functions:invoke send-contact-email --no-identity --payload '{"contactEmail" : "jenna@example.com", "contactName" : "Jenna", "message" : "hello world from a function!"}'

this produces this error:

Error: Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.

Collapse
 
jennapederson profile image
Jenna Pederson

Hey Jeff -

Based on that error, you'll either have to add the email address you're using in the CONTACT_TO_EMAIL_ADDRESS env var to the authorized recipients in your Mailgun Account Settings (see more about that here) or move off the sandbox domain to your very own custom domain.

Hope that helps!