DEV Community

Discussion on: Using Netlify lambda functions to send emails from a GatsbyJS site

Collapse
wispyco profile image
Wispy

I figured out where to put the code, I had a functional component so I was confused as to how to do forms, because the example's I found used classes. Anyways. I am get the following error from Netlfiy Lambda. Any Ideas?

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined

Collapse
wispyco profile image
Wispy

I had to add require('dotenv').config(); in my sendmail.js file, because the env variables were not being found. If anyone runs into the same issue. thanks for the tut!