title: How to set up Nodemailer with Angular 4?
body: <p>I can't find a tutorial anywhere that guides me through the process of setting up nodemailer in Angular 4. I'm not even sure in which file to put the ts from the nodemailer intro on their website:</p>
  
  <pre><code>'use strict';
  const nodemailer = require('nodemailer');
  
  // Generate test SMTP service account from ethereal.email
  // Only needed if you don't have a real mail account for testing
  nodemailer.createTestAccount((err, account) =&gt; {
  
      // create reusable transporter object using the default SMTP transport
      let transporter = nodemailer.createTransport({
          host: 'smtp.ethereal.email',
          port: 587,
          secure: false, // true for 465, false for other ports
          auth: {
              user: account.user, // generated ethereal user
              pass: account.pass  // generated ethereal password
          }
      });
  
      // setup email data with unicode symbols
      let mailOptions = {
          from: '"Fred Foo " &lt;foo@blurdybloop.com&gt;', // sender address
          to: 'bar@blurdybloop.com, baz@blurdybloop.com', // list of receivers
          subject: 'Hello ✔', // Subject line
          text: 'Hello world?', // plain text body
          html: '&lt;b&gt;Hello world?&lt;/b&gt;' // html body
      };
  
      // send mail with defined transport object
      transporter.sendMail(mailOptions, (error, info) =&gt; {
          if (error) {
              return console.log(error);
          }
          console.log('Message sent: %s', info.messageId);
          // Preview only available when sending through an Ethereal account
          console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));
  
          // Message sent: &lt;b658f8ca-6296-ccf4-8306-87d57a0b4321@blurdybloop.com&gt;
          // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...
      });
  });
  </code></pre>
  
  <p>This is a complicated thing and any help would be appreciated! If I knew where to put the code and what it should do, I would be able to piece some things together.</p>