title: How to send an e-mail using mailgun/mailchimp/etc in an express/node.js app
body: <p>I want to send automated e-mails like order brief, sign-in e-mail, confirm e-mail, change password e-mail, etc to clients using mailchimp or mailgun or whatever e-mail delivery server because when I used nodemailer, the clients were receiving the e-mails in their spam inbox and sometimes not receiving at all.<br>
  Here's the code I used:<br></p>
  
  <p>automated_emails.js file:</p>
  
  <pre><code>const nodemailer = require('nodemailer');
  const ejs = require('ejs');
  
  const user = 'xxx'
  const pass = 'xxx';
  
  const transporter = nodemailer.createTransport({
      service: 'gmail',
      auth: { user, pass }
  });
  
  const emailPasswordChange = (email, uuid) =&gt; {
      ejs.renderFile("./mail/forgot-password.ejs", { uuid }, (err, data) =&gt; {
  
          if (err) return console.log(err)
  
          let mailOptions = {
              from: 'xxx',
              to: email,
              subject: "Forgot My Password",
              html: data
          };
  
          transporter.sendMail(mailOptions, (error, info) =&gt; {
              if (error) return console.log(error);
          });
      })
  }
  
  module.exports.emailPasswordChange = emailPasswordChange;
  </code></pre>
  
  <p>The EJS file is a file that contains the template, and I pass to it the user info like e-mail, name, etc.<br>
  They are a bunch of functions I call inside the main index.js file.<br>
  How do you suggest me to implement this? Is there a way I can put mailchimp/mailgun/etc's email delivery method inside my nodemailer app?</p>