Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mailer = require('express-mailer');
- mailer.extend(app, {
- from: 'No Reply <no-reply@no-reply.com>',
- host: 'email-smtp.us-east-1.amazonaws.com',
- secureConnection: false,
- port: 587,
- transportMethod: 'SMTP',
- auth: {
- user: 'user',
- pass: 'password'
- }
- });
- var mailConfig = {
- to: 'me@email.com',
- subject: 'email_subject',
- data: {
- name: 'name'
- }
- };
- var sendOptions = {
- template: 'emailTemplate',
- attachments: [{
- fileName: 'attachment.pdf', filePath: 'data/attachment.pdf'}
- }]
- };
- app.mailer.send(sendOptions, mailConfig, function (err)
- {
- if (err)
- console.log(err + 'n' + __filename + ' ' + __functionName + ' ' + __lineNumber);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement