title: Send email with Loopback 4
body: <p>i am kinda new to Loopback and Typescript so I have no idea how to implement this. I am trying to call Nodemailer directly, but so far I keep getting an error. </p>
  
  <p>My Mailer service: </p>
  
  <pre><code>import { SentMessageInfo } from 'nodemailer';
  import Mail = require('nodemailer/lib/mailer');
  const nodemailer = require("nodemailer");
  
  export class MailerService {
    async sendMail(mailOptions: Mail.Options): Promise&lt;SentMessageInfo&gt; {
      const transporter = nodemailer.createTransport({
        host: 'smtp.ethereal.email',
        port: 587,
        auth: {
          user: 'albert.grimes@ethereal.email',
          pass: 'qN85JT6SneBA9S5dhy'
        }
      });
      return await transporter.sendMail(mailOptions);
    }
  }
  </code></pre>
  
  <p>My Mailer controller: </p>
  
  <pre><code>import { Request, RestBindings, get, ResponseObject } from 
  
  '@loopback/rest';
  import { inject } from '@loopback/context';
  import { MailerService } from "../services";
  
  export class MailController {
    constructor(
      @inject ???
      public mailerService: MailerService
    ) { }
  
    @get('/mail/acceptation')
    async sendEmail(email: string): Promise&lt;any&gt; {
      let info = await this.mailerService.sendMail({
        to: `${email}`,
        subject: 'testmail',
        html: '&lt;p&gt;Hallo&lt;/p&gt;'
      })
      return info;
    }
  }
  </code></pre>
  
  <p>I keep getting this as a error: </p>
  
  <blockquote>
    <p>Unhandled error in GET /mail/acceptation: 500 Error: Cannot resolve injected arguments for MailController.prototype.sendEmail[0]: The arguments[0] is not decorated for dependency injection, but a value is not supplied</p>
  </blockquote>
  
  <p>So what I am gathering from this is that I should inject a value in my controller, but I have no idea what. </p>