0

I have an application, built using React. If I want to send an email to a user after another user successfully completes an action, what are some technologies I need to or can use? To clarify, I have no backend server set up yet.

3
  • React is frontend, emails are sent from a backend server. So React has nothing to do with this. It will greatly depend on the technology stack of your backend server. Commented Feb 8, 2020 at 6:35
  • 1
    see stackoverflow.com/questions/55795125/… Commented Feb 8, 2020 at 6:43
  • @AlexWayne I was hoping for answers containing technologies to use, not technologies I don't need to use. Commented Feb 8, 2020 at 17:19

3 Answers 3

1

Check sendgrid! You can do in your backend(nodejs in this case):

const SGmail = require ('@sendgrid/mail')
SGmail.setApiKey(process.env.REACT_APP_SG_API)

app.post('/your/endpoint', (req,res) => {
const data = req.body
const mailOptions = {
    from: data.email,
    to:'[email protected]',
    subject:'Subject',
    html:`<p>${data.name}</p>
        <p>${data.email}</p>
        <p>${data.message}</p>`
}
SGmail.send(mailOptions).then((err,res)=>{res.redirect('/')})
})
Sign up to request clarification or add additional context in comments.

Comments

1

Check out SendGrid, they offer a generous free tier.

Comments

0

If you're not expected to do the actual email sending, you could, in JS, build an .eml file and have the user "download" it. They would then send it in their client of choice.

Otherwise you will need, at the very least, access to a mail server, to send this multipart-mime to, or, a little safer, build the message on the server and send it internally.

1 Comment

thanks! this is a cool and different way to do it than the other answers!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.