I am new to the Nodejs world. I want to send an email with an embedded image. But my image did not show through email. I thought this could be my file path setting. Here are my mailOptions,
var mailOptions = {
from: 'mymail@gmail.com',
to: to,
subject: subject,
html: html,
attachments: [{
filename: "logo.png",
filePath: "/images/logo.png",
cid: "logo-mail"
}]
};
And my directory that stores my static files,
myproject/
assets/
images/
js/
styles/
And this is my html,
<img src="cid:logo-mail" />
Here is my result in the email,
<img src="cid.php?mid=e_ZGHjAQV4ZQLlAGNkZQNjZGN1AQt3Zt==&pj=logo-mail" alt="cid.php?mid=e_ZGHjAQV4ZQLlAGNkZQNjZGN1AQ">
I am not sure if the file path is set correctly as follows:
filePath: "/images/logo.png"
source
share