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
FluentEmail v3.0.0/ Multiple Cc and Bcc Recipient Issue #287
Comments
You can generate a list of Address (Address is in FluentEmail.Core.Models) and then pass it into .BCC(). Something like this. _BCCAddresses = config.GetSection("BCCAddresses").Get<List<string>>().Select(ea => new Address { EmailAddress = ea }).ToList();
var email = _emailFactory.Create()
.To(toAddress)
.BCC(_BCCAddresses)
.Subject("Subect")
.UsingTemplateFromFile($@"path\to\template", model, true); |
Thank you for your help. C# is still quite new language to me so excuse me for that. I understand that your given example reads a list and returns a list, right? In my case, I get a string containing the email addresses separated by semicolon ";". Could you suggest a handy way to add all those email addresses to a list that would be passed to .CC or BCC? Thanks in advance. |
No worries :) you can use string.split() for that. var emailString = "test1@test.com;test2@test.com;test3@test.com";
var listOfAddress = emailString.Split(";").Select(ea => new Address { EmailAddress = ea }).ToList(); |
Thanks a lot for your assistance. I got it working now. It is strange, though, that you can just pass a string like |
It's just not implemented yet; see #180 Looks like there's already a pull request active for it. |
Ok, hope it will be merged soon. Is it possible to look at the implementation code? |
I am working on an urgent project involving FluentMail to process outgoing email messages.
The problem is that I have not been able to figure out a way to send Cc and/or Bcc messages to multiple recipients, only one.
I have also tested it with hard-coded recipients, like
"tom.tom@acme.com; mickey.moustache@acme.com; don.don@somekiosk.com" OR
"tom.tom@acme.com, mickey.moustache@acme.com, don.don@somekiosk.com".
What happens is that the Cc or Bcc message ends up being sent only to the last recipient in the list.
I would very much appreciate advise on how to send a message to multiple Cc and Bcc reciepients and, if this feature is not currently supported, I hope that this feature would be implemented soon.
The text was updated successfully, but these errors were encountered: