mail attachment scope ?

Hi all,

I would like to know if the file that we attach to a mail using mail.attachment.append must exist until the message is sent
or can we attach the file and destroy it just after ?

I have to attach a serie of small files to an email, and it would be easier to make a local property for the folderitem in a loop.


well I tried on a small app, and it seems that you can destroy the folderitem just after making the attachment.

Since a folderitem is an object reference and the mail holds on to its own reference, it won’t matter if you nil the original as the mail attachment has its own reference. Just don’t delete the actual file on disk :slight_smile: