Skip to content
← Back to Community
Can you send emails in repl?
Profile icon
TheH4ck3r

I'm trying to send an email programmatically trough a repl in Node.js or Python. I have tried Nodemailer so far, but it won't work. Any tips?

Voters
Profile icon
TheH4ck3r
Comments
hotnewtop
Profile icon
TheH4ck3r

It turns out that you CAN send email with replit, with the SendGrid API and a custom domain. Thanks anyway!

Profile icon
Coder100

It won't work because of security.
Search up turn on less secure apps for <application>
for <application> it can either be gmail or hotmail depending on your emial.

Profile icon
codingjlu

Yes you can (in Node.js at least); PHP doesn't work.

Profile icon
Dart

yes, if you use an email server, just look up "how to send email using "

Profile icon
ruiwenge2

yes, you can!
do the following code in node.js:

const gmail = require("gmail-send"); function sendEmail(){ const send = gmail({ user: "YOUR USERNAME", pass: "YOUR PASSWORD", to: "RECEIVERS'S USERNAME", subject: "SUBJECT" }); send({html: "TEXT"}, (error, result, fullResult) => { if (error) console.error(error); console.log(result); }); }
Profile icon
ruiwenge2

one important thing is that in your google account settings, you have to turn on less secure app access

Profile icon
Yimmee

@ruiwenge2
So it didn’t work out....
You do need that on.

Profile icon
Yimmee

@ruiwenge2
Also, html is used for html. It can be plain, but it can also be html.
There’s no difference, but I think you can use text for plain text.

Profile icon
ch1ck3n

i dont think replit allows email sending :(

Profile icon
Yimmee

But NODE DOES @ch1ck3n