Redundant From in DI
"The specified string is not in the form required for an e-mail address"
A few hours of hitting desks and using a hundred different recipient addresses, I found out From was missing. It's sporadically present in the documentation. I don't know why if you add the property via DI; eg:
services.AddFluentEmail("[email protected]") .AddRazorRenderer() .AddSmtpSender(new SmtpClient("[email protected]", smtpSettings.Port) { Credentials = new NetworkCredential(smtpSettings.Account, smtpSettings.Password), EnableSsl = true });
it still needs to be added again in the From parameter? Wouldn't it be better to add the mail passed on here as the default ?
I also think the error handling around this is poor. It wouldn't hurt anybody to put a bit more detailed error message that says 'The 'From' address is not valid.'