New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodemailer doesn't work on Cloudflare Workers because it uses Built-in node modules without node:
prefix
#1621
Comments
Hey @Aloso , why did you close this? I am also deploying on edge functions (Vercel Edge) and it does not work. |
I figured out a better way, and I read somewhere else that smtp connections from serverless environments aren't allowed anyway. Please correct me if I'm wrong. Since I wanted to use it for a contact form, I'm using FormSubmit now, it is very convenient and easy to set up. |
@Aloso alternative approch still does not resolve this issue! Can you please open this issue again it. I am still unable to get it install on cloudflare worker |
I think it will never run on Cloudflare, duplicate of: Personally I switched to use Resend |
I have reviewed all the related issues. It shouldn't be a difficult problem... SMTP seems like just another API but with its own protocol... all it needs is a JS driver to send email from Cloudflare Worker (CFW). CFW provides an API to connect to TCP sockets which is the basic building block. The next step is to go through SMTP protocol specifications and implement the client... something like described here. Personally, I have set up a second server on Vercel running Nodemailer. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
You might find this post insightful: GitHub stale bot consindered harmful |
Cloudflare Workers is a serverless JavaScript runtime. It has a Node.js compatibility mode, but it requires that built-in node modules are imported with the
node:
prefix. Because of this, Nodemailer fails to build on Cloudflare Workers.See this blog post about the
node:
prefix, which is the recommended way to import built-in node modules.Nodemailer requires the
stream
,fs
,path
,url
,http
,https
,zlib
,net
,events
,util
,dns
,child_process
,os
,tls
, andcrypto
built-in modules. These should be imported with prefix, for example:The text was updated successfully, but these errors were encountered: