yo-next-auth/config/mailer.ts

17 lines
707 B
TypeScript

import SMTPTransport from 'nodemailer/lib/smtp-transport'
import { env } from '@/lib/utils'
export const from: string = `"${env('MAIL_SERVER_SENDER_NAME')}" <${env('MAIL_SERVER_USERNAME')}>`
export const transportOptions: SMTPTransport | SMTPTransport.Options | string = {
host: env('MAIL_SERVER_HOST'),
debug: env('MAIL_SERVER_DEBUG') === 'true' && env('NODE_ENV') !== 'production',
logger: env('MAIL_SERVER_LOG') === 'true' && env('NODE_ENV') !== 'production',
port: parseInt(env('MAIL_SERVER_PORT')),
secure: env('MAIL_SERVER_PORT') === '465', // Use `true` for port 465, `false` for all other ports
auth: {
user: env('MAIL_SERVER_USERNAME'), pass: env('MAIL_SERVER_PASSWORD'),
},
}