I am working on a project that uses nodemailer, when i submit the form, i get a 200 sucess and no errors from nodemailer but i don not recieve the email in my mail.
import nodemailer from "nodemailer";
const Email = (options) => {
let transporter = nodemailer.createTransport({
name: '[email protected]',
service: "gmail",
host: "smtp.gmail.com",
port: 587,
secure: false,
auth:{
user:'user',
pass:'password',
}
})
transporter.sendMail(options, (err, info) => {
if (err) {
console.log(err);
return;
}
console.log("Email sent: " + info.response); // Log success message
});
};
//SEND EMAIL
const EmailSender = ({firstName, lastName, email, companyName, typeOfDeveloper, recruitmentType}) => {
const options = {
from: `Darcia⚜️`,
to: `[email protected]`,
subject: "Message from Darcia",
html:`
<div style="width: 100%; background-color: #f3f9ff; padding: 5rem 0">
<div style="max-width: 700px; background-color: #feffe1; margin: 0 auto; background-image: url('https://res.cloudinary.com/dlxrzazn6/image/upload/v1725041898/jepdinustkmgor5cltdp.png'); background-repeat: no-repeat; background-size: 50%; background-position: 130% 300%;">
<div style="width: 100%; background-color: #2b2b2b; padding: 20px 0">
<a href="https://darcia-frontend.vercel.app" >
<img
src="https://res.cloudinary.com/dlxrzazn6/image/upload/v1725043148/mmciecekert56v0xc3y9.png"
style="width: 100%; height: 70px; object-fit: contain"
/>
</a>
</div>
<div style="width: 100%; gap: 10px; padding: 30px 0; display: grid">
<p style="font-weight: 800; font-size: 1.2rem; padding: 0 30px">
Darcia hiring agnecy
</p>
<div style="font-size: .8rem; margin: 0 30px">
<p>FullName: <b>${firstName}</b> <b>${lastName}</b></p>
<p>Email: <b>${email}</b></p>
<p>CompanyName: <b>${companyName}</b></p>
<p>Type of Developer: <b>${typeOfDeveloper}</b></p>
<p>Recruitment type: <b>${recruitmentType}</b></p>
</div>
</div>
</div>
</div>
`
};
Email(options)
}
export default EmailSender;
i have tried using a different mailing service and even changing the host and port but nothing