MVC Mailer SMTP Details Dynamic

Using MVC Mailer Functionality, I gone through requirement that I have to set smtp detail programmatically in my application without using Web.Config items.

I have set programmatically smtp detail, may it will help you.

public ActionResult SendEmailRFQTOAdminMessageAction()
{
   var Model = TempData["yourmodel"] as RFQModel;
   SmtpClient client = new SmtpClient();
   client.DeliveryMethod = SmtpDeliveryMethod.Network;
   client.Host = "mail.XXXXXXX.com";
   client.Credentials = new NetworkCredential("[email protected]", "xxxxxx");
   SmtpClientWrapper wrapper = new SmtpClientWrapper(client);
   UserMailer.EmailRFQTOAdmin(Model).Send(wrapper); //Send() extension method: using Mvc.Mailer
   return RedirectToAction("ThanksView","YourController");
}