title: ERROR ReferenceError: nodemailer is not defined
body: <p>i already add in tsconfig.app.json "types": ["node"]</p>
  
  <p>i just want to create a simple email sender using angular 5..</p>
  
  <p>if there's a link other tutorial using google mail API please give me a link</p>
  
  <p><strong>heres my code</strong></p>
  
  <pre><code>import { Component, OnInit, Input, EventEmitter } from '@angular/core';
  
  declare var nodemailer: any;
  
  @Component({
    selector: 'app-contact',
    templateUrl: './contact.component.html',
    styleUrls: ['./contact.component.css']
  })
  
  export class ContactComponent implements OnInit {
  
    constructor() {}
  
    ngOnInit() {
      let transporter = nodemailer.createTransport({
        service: 'gmail',
        auth: {
          type: 'OAuth2', 
          user: 'XXX@gmail.com',
          clientId: 'XXX-XXX.apps.googleusercontent.com',
          clientSecret: 'SY0-XXXX',
          refreshToken: '1/XXX_XXX',
          accessToken: 'ya29.XXX-XXX-XXX-XXX'
        }
      })
  
      let mailOptions = {
        from: 'FReyes &lt;XXX@gmail.com&gt;',
        to: 'XXX@gmail.com',
        subject: 'Nodemailer test',
        text: 'Hello World!!'
      }
  
      transporter.sendMail(mailOptions, function (err, res) {
        if(err){
            console.log('Error');
        } else {
            console.log('Email Sent');
        }
      })
    }
  }
  </code></pre>
  
  <p><strong>i'm using nodemailer
  here's my error</strong></p>
  
  <p><a href="https://i.stack.imgur.com/HOYEd.png" rel="nofollow noreferrer">error preview</a></p>