import { render } from '@react-email/render';
import nodemailer from 'nodemailer';
import Email from './templates/test';
export default async function sendEmail() {
const transporter = nodemailer.createTransport({
host: 'smtp-mail.outlook.com',
port: 587,
secure: true,
auth: {
user: '[email protected]',
pass: '...',
},
});
const emailHtml = render(<Email />);
const options = {
from: '[email protected]',
to: '[email protected]',
subject: 'hello world',
html: emailHtml,
};
await transporter.sendMail(options);
}
import { render } from '@react-email/render';
import nodemailer from 'nodemailer';
import Email from './templates/test';
export default async function sendEmail() {
const transporter = nodemailer.createTransport({
host: 'smtp-mail.outlook.com',
port: 587,
secure: true,
auth: {
user: '[email protected]',
pass: '...',
},
});
const emailHtml = render(<Email />);
const options = {
from: '[email protected]',
to: '[email protected]',
subject: 'hello world',
html: emailHtml,
};
await transporter.sendMail(options);
}