邮件配置是 Nlog.config 文件
<target name="mail" xsi:type="Mail" smtpServer="smtp.emailsrvr.com" smtpPort="25" smtpUserName="samplemail@samplemail.com" smtpPassword="Password"
from="sample-test@intsof.com" to="vinay@sample.com" subject="Hello Mail from Nlog" html="false" encoding="UTF8"/>
<rules>
<logger name="*" level="Error" writeTo="mail"/>
App.config 中的配置。
<configuration>
<system.net>
<mailSettings>
<smtp from="Sample-test@sample.com" deliveryMethod="Network">
<network defaultCredentials="true" userName="vinay-test@sample.com" password="Password" host="smtp.emailsrvr.com" port="25"/>
</smtp>
</mailSettings>
</system.net>
</configuration>
如果我使用传递方法 SpecifiedPickupDirectory 并给出一个本地路径,那么它会发送邮件,但不会发送到 Outlook。