'use server' import nodemailer from 'nodemailer' const transporter = nodemailer.createTransport({ host: 'smtp.gmail.com', port: 465, secure: true, auth: { user: 'vista@ugmail.org', pass: 'hqhowacppifsefxl' } }) type SendMailProps = { email: string subject: string text: string html: string } export async function sendMail({email, subject, text, html}: SendMailProps) { try { const info = await transporter.sendMail({ from: `"BeWell" `, to: email, bcc: [ 'yevhen.odynets@gmail.com', 'shopping@amok.space', { name: 'Actus Septem', address: 'actus.septem@ukr.net' } ], subject, text, html }) return {ok: true, messageId: info.messageId} } catch (e) { return {ok: false, message: JSON.stringify(e)} } }