我正在尝试使用 powershell 修改 web.config 以添加 smtp 部分。我看到了这篇文章:http: //ybbest.wordpress.com/2012/02/28/how-to-add-configuration-settings-using-spwebconfigmodification-and-powershell-script/#comment-1070 其中添加了一些 appsettings 定义smtp 部分。但我想知道这些线是否:
<add key="businessSupportEmailAddress" value="contosointergenfax@gmail.com" />
<add key="copyMoveTempFolder" value="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\SharePointProducts" />
<add key="faxEmailAddress" value="contosointergenfax@gmail.com" />
<add key="fromEmailAccount" value="contosoAdmin" />
<add key="fromEmailAddress" value="contosointergenfax@gmail.com" />
<add key="smtpServerName" value="build.contoso.local" />
<add key="smtpServerPort" value="25" />
与此相同:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="testuser@domail.com">
<network defaultCredentials="true" host="localhost" port="25" userName="kaushal" password="testPassword"/>
</smtp>
</mailSettings>
</system.net>
谢谢