FluentEmail icon indicating copy to clipboard operation
FluentEmail copied to clipboard

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

Open johnkwaters opened this issue 1 year ago • 1 comments

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();

johnkwaters avatar Oct 02 '23 16:10 johnkwaters

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

YevheniiStepaniuk avatar Jan 09 '24 09:01 YevheniiStepaniuk