import nodemailer from 'nodemailer';
import sendmailTransport from 'nodemailer-sendmail-transport';

const transporter = nodemailer.createTransport(sendmailTransport());

export default transporter;

import nodemailer from 'nodemailer';
import sendmailTransport from 'nodemailer-sendmail-transport';

import { smtpOptions } from '../config';

const transporter = nodemailer.createTransport(
  smtpOptions || sendmailTransport()
);

export default transporter;

Allow config to specify smtpOptions instead of sendmail
Allow config to specify smtpOptions instead of sendmail
