Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] SendExchangeEmailWithAttachments: AttachmentFromString attachments are duplicated #65

Open
HiQ-wipa opened this issue Feb 23, 2024 · 0 comments

Comments

@HiQ-wipa
Copy link

Description

If the task SendExchangeEmailWithAttachments is given multiple AttachmentFromString attachments, then the first attachment is duplicated.

Steps to reproduce

Call SendExchangeEmailWithAttachments with 2 AttachmentFromString attachments.

Expected behaviour

Each attachment should only appear once in the resulting email.

Notes

This occurs because the allAttachmentFilePaths loop is contained within the attachments loop. Abridged, the code looks like this:

foreach (var attachment in attachments) {
    allAttachmentFilePaths.Add(getFilePath(attachment));
    foreach (var filePath in allAttachmentFilePaths) {
        attachFileToEmail(filePath, email);
    }
}

In other words, with 2 attachments, the first iteration of the outer loop attaches the first attachment, and the second iteration attaches the first attachment again and then the second attachment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant