Replies: 2 comments
-
the error is coming from Line 230 in 8b3c0b1 likely your path to the image is not aligned with the directory your process is running from. you can look at one of our tests to see how we approach image embedding https://github.com/eleith/emailjs/blob/main/test/message.ts#L218 |
Beta Was this translation helpful? Give feedback.
-
Yes, sorry, my bad. Turns out this has nothing to do with emailjs but rather with NextJS. I'm using emailjs in NextJS's /page/api folder and I guess it handles paths a little different therefore I needed to use absolute path. (No idea if that's the best solution) Thank you for your reply tho! |
Beta Was this translation helpful? Give feedback.
-
Hi. I can't seem to figure out why, but whenever I try to attach a file while sending email, I get the error:
Error: image.jpeg does not exist
I'm using nextJs with emailjs, and I have a file image.jpeg in /public/image.jpeg, I've tried these combinations:
None of these seem to work
I'm constructing my message this way:
const message = { ... attachment: [ {data:
..., alternative: true}, { path: '/image.jpeg', type: 'image/jpeg', name: 'image.jpeg' }, ], };
What am I missing here? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions