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

The fluent method .To appends to the list of To Addresses #378

Open
johnkwaters opened this issue Oct 2, 2023 · 1 comment
Open

The fluent method .To appends to the list of To Addresses #378

johnkwaters opened this issue Oct 2, 2023 · 1 comment

Comments

@johnkwaters
Copy link

I was looping through a list of people to send emails to, using the same instance of FluentEmail and each person got all the previous peoples emails!
Turns out .To APPENDS to the list of To Addresses.
I thin this is a bug - the "feel" of setting to is to make To the ONLY addressee.
Appending would be a method like "AddRecipient", IMO
Fixed by prefixing all usages with

    // .To APPENDS to the To List!
    _fluentEmail.Data?.ToAddresses?.Clear();
@YevheniiStepaniuk
Copy link

I had same issue and spent a lot of time checking what might be problem. At the end I came up with replacing IFluentEmail with IFluentEmailFactory

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

2 participants