Node.js 如何限制NodeEmailer中的文件大小?

Node.js 如何限制NodeEmailer中的文件大小?,node.js,email,attachment,email-attachments,Node.js,Email,Attachment,Email Attachments,我正在用NodeEmailer发送大量附加的pdf文件(如果需要,我可以提供代码) 现在,我需要将发送的总文件大小限制为10MB,如果超过10MB,它应该发送下一封电子邮件,并在停止的位置继续 我该怎么做 谢谢。我会给你想法,你会写代码。询问您以后是否需要有关已编写代码的帮助 // List all Attachments that must be sent // For each Attachment, get the size of it using fs.statSync() // K

我正在用NodeEmailer发送大量附加的pdf文件(如果需要,我可以提供代码)

现在,我需要将发送的总文件大小限制为10MB,如果超过10MB,它应该发送下一封电子邮件,并在停止的位置继续

我该怎么做


谢谢。

我会给你想法,你会写代码。询问您以后是否需要有关已编写代码的帮助

// List all Attachments that must be sent

// For each Attachment, get the size of it using fs.statSync()

// Knowing the number of attachments and the size of each, divide them in groups where the sum of the file size of each group is less than 10MB

// Send one e-mail per group