SmtpClient and app.config system.net configuration

前端 未结 2 1743
深忆病人
深忆病人 2021-02-14 05:29

I\'m having an issue with a .NET 3.5 library I\'m developing to send emails. I put the system.net configuration into app.config:



        
2条回答
  •  南笙
    南笙 (楼主)
    2021-02-14 06:08

    I've just realized I'm definitely doing it the wrong way (there's also a similar post from John about it and the solution is there...).

    The mailsettings is available only at the application level, so the test project should know about your settings to take them into account.

    Thanks to John and Davide for pointing me to the right direction!

提交回复
热议问题