Open ngudritz opened 9 years ago
It doesn't look like a single email can be overridden, but you can override the SMTP client creation: https://github.com/andrewdavey/postal/blob/master/src/Postal/EmailService.cs
That would require you to create a new instance of EmailService every time you wanted to send an email, rather than injecting an instance in your object's constructor.
I can see something like this being useful in a handful of projects, so if you can elaborate on your use-case(s) a bit, I could take a stab at something a little more "friendly".
It would be great if the SMTP could be configured using code as well. A use case is that i do not want to store passwords in the Web.config, b/c we are required to store the credentials in a key vault.
I have default smtp settings configured in the web.config, but we need to be able to change the sender credentials based on the type of email going out. It looks like no matter what, Postal uses what's in the web.config without a way of overriding it. Is this true or is there another way to the smtp credentials for a single email at runtime?