Hello,
I have a problem with netlify function which sends an email.
It has been working before but after I moved the domain from my hosting to a netlify it gives me this kind of error:
I added MX records to a DNS configuration, I know it might take some time to update them, but basically, it is already passed 24hours.
I’m not sure if this error is related to DNS configuration or maybe I’m just missing something else.
So you are using Netlify DNS for regina.lv, that I can see. I also see you have mail.regina.lv set up (which I might assume is the process.env.MAIL_HOST value), however it appears to point to nowhere.
Which email provider do you use (Zoho, Google, Microsoft, etc)?
Your function looks almost identical to the one I use so cannot see how it would error otherwise.
regina.lv is in Netlify DNS pointing to a Netlify website, and as Netlify does not provide email service (as per previously linked Support Guide, your MX destination needs to point to a third-party service (such as Zoho) in order for you to send and receive email using your domain. The service you use will dictate what DNS records you need to configure and what settings you will use to send/receive email.
Thanks for the suggestions, i changed my mail provider to Zoho, manage to set-up everything and it works fine in development, but in production still this weird error: