Closed staoran closed 1 year ago
I started adding DefaultFrom but never finished the UAT side of it, so thanks for the pull request! There's actually a growing list of features like this that I've implemented but haven't added to the wiki (or the interface) because I haven't tried them in a production environment yet.
I think part of the reason why I didn't add this was because what if you want to reuse the subject line as well? Or an attachment? This is a much more likely scenario, but in those cases you can use the email.Copy()
method. I'll merge this anyway though as now I know at least one person will use that feature.
But you mentioned that you have completed similar functions, we can completely accept the version you have already done. The reason I want this functionality is because my needs are particularly simple. I only use the function of sending mail. Send an email to myself when the program generates an exception, so I want to let me write less code through configuration items. 😄I'm so lazy.
Haha if the definition of lazy is "achieving maximum benefit from minimum effort" then we should all stive to be more lazy!
I've made some changes to bring it more in line with the receiver library, try the new alpha release and give me a thumbs up if it's all good.
1 : Add DefaultFrom method missing in IEmailWriter interface. 2 : Add the DefaultFrom attribute to EmailSenderOptions, and you can use the "await _writeEmail.To("test@localhost").SendAsync();" method directly without using the From method.