我正在尝试在 web.config 文件中设置两个 smtp 服务器,但出现错误
Unrecognized configuration section system.net/mailSettings/smtp_1.
如何正确地做到这一点?
<configuration>
<configSections>
<sectionGroup name="mailSettings">
<section name="smtp_1" type="System.Net.Configuration.SmtpSection"/>
<section name="smtp_2" type="System.Net.Configuration.SmtpSection"/>
</sectionGroup>
</configSections>
<system.net>
<mailSettings>
<smtp_1 from="no-reply1@web2pdfconvert.com" deliveryMethod="specifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="C:\Users\Administrator\Projects\temp\wp" />
<network host="smtp...." enableSsl="true" userName="..." password="..." port="587" />
</smtp_1>
<smtp_2 from="no-reply2@web2pdfconvert.com" deliveryMethod="specifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="C:\Users\Administrator\Projects\temp\wp" />
<network host="smtp...." port="25" />
</smtp_2>
</mailSettings>
</system.net>
</configuration>