2024-09-26 11:51:35 +00:00
|
|
|
import env from '#start/env';
|
|
|
|
import { defineConfig, transports } from '@adonisjs/mail';
|
2024-09-16 15:59:46 +00:00
|
|
|
|
|
|
|
const mailConfig = defineConfig({
|
2024-09-26 11:51:35 +00:00
|
|
|
default: 'smtp',
|
|
|
|
from: 'tethys@geosphere.at',
|
|
|
|
/**
|
|
|
|
* The mailers object can be used to configure multiple mailers
|
|
|
|
* each using a different transport or same transport with different
|
|
|
|
* options.
|
|
|
|
*/
|
|
|
|
mailers: {
|
|
|
|
|
|
|
|
smtp: transports.smtp({
|
|
|
|
socketTimeout: 5000,// Overall timeout (5 seconds)
|
|
|
|
host: env.get('SMTP_HOST', ''),
|
|
|
|
port: env.get('SMTP_PORT'),
|
|
|
|
secure: false,
|
|
|
|
// ignoreTLS: true,
|
|
|
|
requireTLS: false,
|
2024-09-16 15:59:46 +00:00
|
|
|
|
2024-09-26 11:51:35 +00:00
|
|
|
/**
|
|
|
|
* Uncomment the auth block if your SMTP
|
|
|
|
* server needs authentication
|
|
|
|
*/
|
|
|
|
/* auth: {
|
2024-09-16 15:59:46 +00:00
|
|
|
type: 'login',
|
|
|
|
user: env.get('SMTP_USERNAME'),
|
|
|
|
pass: env.get('SMTP_PASSWORD'),
|
|
|
|
}, */
|
2024-09-26 11:51:35 +00:00
|
|
|
}),
|
2024-09-16 15:59:46 +00:00
|
|
|
|
2024-09-26 11:51:35 +00:00
|
|
|
resend: transports.resend({
|
|
|
|
key: env.get('RESEND_API_KEY'),
|
|
|
|
baseUrl: 'https://api.resend.com',
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default mailConfig;
|
2024-09-16 15:59:46 +00:00
|
|
|
|
|
|
|
declare module '@adonisjs/mail/types' {
|
2024-09-26 11:51:35 +00:00
|
|
|
export interface MailersList extends InferMailers<typeof mailConfig> {}
|
2024-09-16 15:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// const mailConfig = defineConfig({
|
|
|
|
// default: 'smtp',
|
|
|
|
|
|
|
|
// /**
|
|
|
|
// * The mailers object can be used to configure multiple mailers
|
|
|
|
// * each using a different transport or same transport with different
|
|
|
|
// * options.
|
|
|
|
// */
|
2024-09-26 11:51:35 +00:00
|
|
|
// mailers: {
|
2024-09-16 15:59:46 +00:00
|
|
|
// smtp: transports.smtp({
|
|
|
|
// host: env.get('SMTP_HOST', ''),
|
|
|
|
// port: env.get('SMTP_PORT'),
|
|
|
|
// /**
|
|
|
|
// * Uncomment the auth block if your SMTP
|
|
|
|
// * server needs authentication
|
|
|
|
// */
|
|
|
|
// /* auth: {
|
|
|
|
// type: 'login',
|
|
|
|
// user: env.get('SMTP_USERNAME'),
|
|
|
|
// pass: env.get('SMTP_PASSWORD'),
|
|
|
|
// }, */
|
|
|
|
// }),
|
2024-09-26 11:51:35 +00:00
|
|
|
|
2024-09-16 15:59:46 +00:00
|
|
|
// resend: transports.resend({
|
|
|
|
// key: env.get('RESEND_API_KEY'),
|
|
|
|
// baseUrl: 'https://api.resend.com',
|
|
|
|
// }),
|
2024-09-26 11:51:35 +00:00
|
|
|
|
2024-09-16 15:59:46 +00:00
|
|
|
// },
|
2024-09-26 11:51:35 +00:00
|
|
|
// })
|