You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
657 B

import nodemailer from "nodemailer";
import dotenv from "dotenv";
dotenv.config();
export const sendEmail = async (subject: string, text: string) => {
const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: "wheeparamsoft.mail",
pass: "gjyr slpt zwhv whvf",
},
});
const mailOptions = {
from: "support@wheeparam.com",
to : "songwritersg@naver.com",
subject,
text,
};
try {
await transporter.sendMail(mailOptions);
} catch (error) {
console.error("Email sending error:", error);
throw error;
}
};