SMTP configuration environment configuration pickupdirectorylocation

I am trying to use an environment variable in the SMTP configuration for the specified pickup directory location. For instance.

<smtp deliveryMethod="SpecifiedPickupDirectory" from=" test@test.com "> <specifiedPickupDirectory pickupDirectoryLocation="%TESTFOLDER%"/> </smtp> "%TESTFOLDER% = C:\Test 

But back to the error, saying that the path must be absolute.

Any ideas how I can make this work? Or even if it is possible!

+4
source share
1 answer

You cannot use it like that.

What you can do is set the name env. variable in your app.settings settings, and then set pickupDirectoryLocation to code using System.Environment.GetEnvironmentVariable .

Or lose env. variable completely and use a configuration file that includes (preferably).

+1
source

Source: https://habr.com/ru/post/1342784/


All Articles