I am currently migrating my Next.js app to Cloudflare Pages. I have used SendGrids Web API to send e

I am currently migrating my Next.js app to Cloudflare Pages. I have used SendGrids Web API to send emails (e.g. for my contact forms). That does not work after switching to the Edge runtime because SendGrid seems to use Axios to send their emails (as i found in my error message and analyzing the sub-dependencies). What is the go-to solution for such cases? Do I need to use SMTP relays or is there an easier solution?

Current error (after submitting a valid form to my edge runtime configured api endpoint):
[AxiosError: There is no suitable adapter to dispatch the request since :
- adapter xhr is not supported by the environment
- adapter http is not available in the build] {
  message: 'There is no suitable adapter to dispatch the request since :\n- adapter xhr is not supported by the environment\n- adapter http is not available in the build',
  name: 'AxiosError',
  code: 'ERR_NOT_SUPPORT'
}
Was this page helpful?