0
I need to search "sectionGroup" values, as I had to do several sections, it is necessary to use it, however, when trying to search, the value always receives Error.
Knowing that There is no Smtpsection type in Dotnet Core, which type I could use.
Appconfiguration.Config
<sectionGroup name="mailSettings">
<section name="mailtrap" type="System.Net.Configuration.SmtpSection"/>
<section name="sendgrid" type="System.Net.Configuration.SmtpSection" />
</sectionGroup>
<appSettings configSource="AppSettings.config" />
<appSettings>
<!--Configuração String Mail e Conexão-->
<add key="mail-sender" value="mailtrap"/>
<add key="is-production" value="false"/>
</appSettings>
code
var getsection = (SmtpClient)ConfigurationManager.GetSection("Mailsettings/mailtrap")