Closed bobrov-site closed 6 months ago
I have nuxt config file
mail: { message: { to: process.env.NUXT_ADMIN_MAIL_USER, }, smtp: { host: 'smtp.mail.ru', port: 465, secure: true, auth: { user: process.env.NUXT_ADMIN_MAIL_USER, pass: process.env.NUXT_ADMIN_MAIL_PASSWORD, }, } }
But, i want to send message to another recipient, not admin in nuxt config file. How can i do it? I have below my example code for sending. Can you please provide best practicies?
const { $mail } = useNuxtApp(); const from = useRuntimeConfig().public.adminMailUser console.log($mail, 'mail') try { await $mail.send({ from: from, subject: subject, text: text, message: { to: to } }) } catch (e) { return { error: e.message } }
@dword-design can you help me with this problem?
I have nuxt config file
But, i want to send message to another recipient, not admin in nuxt config file. How can i do it? I have below my example code for sending. Can you please provide best practicies?