Nodemailer fails to send attachments

Viewed 295

I have tried all the solutions indicated by other similar questions, but none solved my case. Still I can't send attachment. The mail is sent, apparently with the attach, also appears at the client side with the attachment, but it is an empty file. I tried the most simple example, from the doc, ...

attachments[ filename: 'text1.txt', content: 'hello world!']

and it does work!, but for files in the disk, that is: ....

attachments: [ filename: 'text3.txt', path: '/path/to/file.txt' ]

this does not work. Also I have to change filename to fileName and path to pathName, otherwise it gives ENOENT...not such file or directory... As I said, the mail is sent without error, but the attachment is an empty file. Any suggestions? the nodemailer is version v6.6.3

0 Answers
Related