public void Service(IServiceProvider provider)
{
MonoRailConfiguration config = (MonoRailConfiguration) provider.GetService(typeof(MonoRailConfiguration));
sender = new SmtpSender(config.SmtpConfig.Host);
sender.Port = config.SmtpConfig.Port;
if (config.SmtpConfig.Username != null && config.SmtpConfig.Username != String.Empty)
{
sender.UserName = config.SmtpConfig.Username;
}
if (config.SmtpConfig.Password != null && config.SmtpConfig.Password != String.Empty)
{
sender.Password = config.SmtpConfig.Password;
}
}