"To" is required when sending to Undisclosed Recipients
I want to send to only BCC (Undisclosed Recipients) where i dont want to specify a To-address.
.To(" ") Unhandled Exception: System.FormatException: The specified string is not in the form required for an e-mail address. Parameter name: address
.To("") Unhandled Exception: System.ArgumentException: The parameter 'address' cannot be an empty string Parameter name: address
No .To() at all: Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: address
Example:
var mail = _email.Subject(email.Subject).Body(email.Body);
if (email.To != null)
mail = mail.To(email.To);
if (email.Cc != null)
mail = mail.CC(email.To);
if (email.Bcc != null)
mail = mail.BCC(email.To);
if (email.Attachment != null)
mail = mail.Attach(email.Attachment);
await mail.SendAsync();```
I think this should be supported too. However, I guess normally if you want your recipients to not know about each other, you could just send them a separate email. It's not too hard since it's automated, while sending only using BCC is more of a human to human thing.
Which sender are you getting this problem with?
@matt-goldman I was using the sendgrid sender