我需要在 web.config 转换中更改 SMTP 主机值。这是我所拥有的:
<system.net>
<mailSettings>
<smtp from="some@sioem.com">
<network host="localhost" userName="" password=""/>
</smtp>
</mailSettings>
</system.net>
我应该如何将它放在 web.release.config 中,而不是 localhost 它说 192.168.1.9 ?
我像这样转换连接字符串,但不确定如何使用 smtp 进行转换
<connectionStrings>
<add name="CoreModelContext"
connectionString="metadata=&"" providerName="System.Data.EntityClient"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
最佳答案
<system.net>
<mailSettings>
<smtp>
<network xdt:Transform="Replace" host="192.168.1.9" userName="" password="" />
</smtp>
</mailSettings>
</system.net>
关于asp.net - 如何在我的 web.config.release 中转换这部分 webconfig?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6381346/