“The SMTP host was not specified.” - but it is specified?
I'm slightly baffled here - I'm receiving the following error: The SMTP host was not specified. Even though my code appears to be correct (from what I can see). I am able to do it manually by including all the details inside of the controller, e.g. SmtpClient smtpClient = new SmtpClient("smtp.gmail.com"); smtpClient.Port = 587; ... etc But I shouldn't have to do this, as I want to use the details inside mailSettings (Making it re-usable for various different controllers). mailSettings in my Web.Config file: <system.net> <mailSettings> <smtp from="example@gmail.com" deliveryMethod="Network" >