public void Initialize(Dictionary <string, string> parameters)
        {
            var args = new SecureEmailProcessorArguments();

            if (parameters.ContainsKey("host"))
            {
                args.Host = parameters["host"];
            }

            if (parameters.ContainsKey("port"))
            {
                args.Port = parameters["port"].SafeConvert <Int32>();
            }

            if (parameters.ContainsKey("user"))
            {
                args.UserName = parameters["user"];
            }

            if (parameters.ContainsKey("password"))
            {
                args.Password = parameters["password"];
            }

            Initialize(args);
        }
 private void Initialize(SecureEmailProcessorArguments args)
 {
     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
     _client = new SmtpClient(args.Host, args.Port)
     {
         EnableSsl   = true,
         Credentials = new NetworkCredential(args.UserName, args.Password),
     };
 }
 public SecureEmailProcessor(SecureEmailProcessorArguments args)
 {
     Initialize(args);
 }