My nodemailer is sending the attachment with the filename, and it's empty.
I asked previously for help on this and haven't gotten any response, hopefully, this time, I will. Nodemailer sending attachment using sendinblue
Server.js
const cName = req.body.cName;
const cAddress = req.body.cAddress;
const phone = req.body.phone;
const email = req.body.email;
const vName = req.body.vName;
const vAddress = req.body.vAddress;
const violation = req.body.violation;
let fileMultiple = req.body.fFileMultiple;
let mail = {
from: "hello@gmail.com",
to: "email@gmail.com",
subject: `Complaint from ${cName} on ${vName}`,
html: `The message is from ${cName} <br />
Complaint's Name: ${cName} <br />
Complaint's address: ${cAddress} <br />
Email: ${email} <br />
Phone: ${phone} <br />
Violator's Name: ${vName} <br />
Violator's Address: ${vAddress} <br />
Violation: ${violation} <br />`,
attachments: [
{
filename: fileMultiple,
contentType: "images/jpeg",
},
],
};
contactEmail.sendMail(mail, (error) => {
if (error) {
console.log(error);
} else {
console.log("Message has been sent");
}
});
});
Complaint.js
<Form.Label>Multiple Photos Allowed</Form.Label>
<Form.Control type='file' accept='.jpg, .png, .jpeg' />
</Form.Group>
</Col>
</Row>
</Form.Group>
<Button type='submit' value={"submit"}>
{status}
</Button>
----_NmP-852038be5b3ad90e-Part_1 Content-Type: images/jpeg; name="C:\fakepath\sea-turtle-wave-attunation.JPG" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="C:\fakepath\sea-turtle-wave-attunation.JPG"
----_NmP-852038be5b3ad90e-Part_1--