From the NLog FallbackGroup documentation on GitHub:
<targets>
<target xsi:type="FallbackGroup" name="String" returnToFirstOnSuccess="Boolean">
<target xsi:type="wrappedTargetType" ... />
<target xsi:type="wrappedTargetType" ... />
...
<target xsi:type="wrappedTargetType" ... />
</target>
</targets>
List your targets in the order you wish NLog to attempt to use them. Don't forget to set the name="String"
(in your case "email") and the returnToFirstOnSuccess="Boolean"
, usually "true" but maybe not for you, depending on why you had to failover/fallback. If it is usually just a transient problem, switching back to the primary makes sense. If it is usually because the primary server goes down for extended periods, you may want to set it to false so that a successful log using the secondary server doesn't make NLog switch back to the primary each time since it will just end up doing the fallback again.