XML-file
Setup
public class SmtpEmailSettings
{
public string Host { get; set; }
public int Port { get; set; }
}<?xml version="1.0" encoding="utf-16"?>
<SmtpEmailSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Host>smtp.example.com</Host>
<Port>25</Port>
</SmtpEmailSettings>services.AddConfiguration()
.AddXml<SmtpEmailSettings>("path_to_xml_file");Last updated