Last post May 15, 2018 10:27 AM by mgebhard
May 15, 2018 07:27 AM|sayitfast|LINK
Finally making the switch from forms to razor pages... I used to store my email settings in the web.config
<smtp deliveryMethod="Network" from="firstname.lastname@example.org">
<network defaultCredentials="false" host="smtp.gmail.com" port="587" userName="xxxx" password="xxxxxx" />
I have created a contact form that works but I really would like to store settings in a better location. I'm using 'System.Net.Mail;' to create the form.
Where and how can I store these in a MVC Razor Pages app?
May 15, 2018 10:27 AM|mgebhard|LINK
In Core Razor Pages, configuration is stored in the appsetting.json file. See the fundamental docs for general information on using ASP Core configuration. There's a lot to go through. You'll need to find an approach that fits.