Can you send emails in repl?
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?
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.
Yes you can (in Node.js at least); PHP doesn't work.
yes, if you use an email server, just look up "how to send email using "
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); }); }
one important thing is that in your google account settings, you have to turn on less secure app access
@ruiwenge2
So it didn’t work out....
You do need that on.
@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.
It turns out that you CAN send email with replit, with the SendGrid API and a custom domain. Thanks anyway!