I am trying to setup simple but complete ASP.NET MVC 4 web app, where I can send email to specific address, I configure the web.config file for SMPT settings and code in controller call, but I am getting error message "The SMTP host was not specified"
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="myEmail@hotmail.co.uk">
<network host="smtp.live.com" port="25" userName="myEmail@hotmail.co.uk" password="myPassword" defaultCredentials="true"/>
</smtp>
</mailSettings>
in controller class
var mailMessage = new MailMessage();
mailMessage.To.Add("yourEmail@hotmail.co.uk");
mailMessage.Subject = "testing 2 ";
mailMessage.Body = "Hello Mr. Aderson";
mailMessage.IsBodyHtml = false;
var smptClient = new SmtpClient { EnableSsl = false };
smptClient.Send(mailMessage);
many thanks