Ask coding questions

← Back to all posts
ruiwenge2 (604)

How can I send emails with Python or Node.js?

Answered by Yimmee (31) [earned 5 cycles]
View Answer
Yimmee (31)

see my yimmee repl. its not a pro thing, but i used my gmail to send emails.

gmail = require("gmail-send");
function sendEmail(to, subject, html){
  const send = gmail({
    user: '[email protected]',
    pass: process.env.emailPassword,
    to:   to,
    subject: subject
  send({html: html},(error, result, fullResult)=>{
    if (error) console.error(error);
ruiwenge2 (604)

@Yimmee is the password just your gmail password?

Yimmee (31)

i added copiable code so you can just get it over with. remember to use secrets!

Yimmee (31)

it worked right @ruiwenge2?
i just remembered on it said that i need to turn on less secure app access

Xenity (9)

@Yimmee There is a WAYYYY better way to do this, just use a mailto link: "[email protected]?subject=(your email subject)&body=(your body)" (unless you want to auto-send the email)

Xenity (9)

@Xenity you just have to put mailto: before the link (it's a link because mailto counts as a link)

Yimmee (31)

"with Python or Node.js"-OP
"In the browser"