I am trying to use an environment variable in SMTP config for the specified pickup directory location. E.g.
<开发者_如何学Go;smtp deliveryMethod="SpecifiedPickupDirectory" from="test@test.com">
<specifiedPickupDirectory pickupDirectoryLocation="%TESTFOLDER%"/>
</smtp>
"%TESTFOLDER% = C:\Test
But getting back an error saying the path must be absolute.
Any ideas how I can get this to work? Or even if it's possible!
You can't use it like that.
What you can do is set the name of the env. variable in your app.settings and then set the pickupDirectoryLocation in code using the System.Environment.GetEnvironmentVariable method.
Or loose the env. variable completely and use a config file include (preferred).
精彩评论