@
@
@Licvid2017-02-08 01:05:18
Node.js
@Licvid, 2017-02-08 01:05:18

Angular 2 how to send email using typescript?

Is it possible to use the nodemailer module in a file with the .ts extension and use it to send emails.

const nodemailer = require('nodemailer');

let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
  user: '[email protected]',
  pass: 'your pass'
}
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yustas Alexu, 2017-02-08
@Yuxus

nodemailer runs on the server, not in the browser. Make a service in Angular that will interact with the server on the node.

E
emp1re, 2017-02-08
@emp1re

Can. To install typing and work with .ts, there is no significant difference with .js except for typings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question