I want to get the SMTP from address from my Web.config
, I am not sure how to do this below is my code from Web.config
file.
system.net>
<mailSettings>
<smtp from="yourmail@gmail.com">
In my controller, I want to read the Web.config
data, how do I do this?
I used the code below but it didn't work.
var fromAddress = new MailAddress("from@gmail.com", "From Name"); //Add from email from web config file