Esempio n. 1
0
 private MailInfo(string hostname, int hostport, string username, string password, string from, SecurityEnum security)
 {
     From     = from;
     Security = security;
     Hostname = hostname;
     Hostport = hostport;
     Username = username;
     Password = password;
 }
 public CustomSecurityAttribute(SecurityEnum security)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SceneSecurityModeRequest" /> class.
 /// </summary>
 /// <param name="actionId">the id of the action to be created. Optional, sent by Reaver only.</param>
 /// <param name="security">The id of the security mode (required).</param>
 /// <param name="arguments">Additional query param.</param>
 public SceneSecurityModeRequest(string actionId = default(string), SecurityEnum security = default(SecurityEnum), string arguments = default(string))
 {
     this.Security  = security;
     this.ActionId  = actionId;
     this.Arguments = arguments;
 }
Esempio n. 4
0
        private static ISmtpService GetCorrectSmtpService(String hostname, Int32 hostport, SecurityEnum security)
        {
            switch (security)
            {
            case SecurityEnum.None:
                return(new SmtpService(hostname, hostport));

            case SecurityEnum.Ssl:
                return(new SslSmtpService(hostname, hostport));

            case SecurityEnum.StartTls:
                return(new StartTlsSmtpService(hostname, hostport));

            default:
                throw new SmtpException($"Il livello di sicurezza {security} non e' gestito");
            }
        }
Esempio n. 5
0
        public SendEmailClient(string hostname, int hostport, string username, string password, SecurityEnum security)
        {
            var user = new SmtpUser(username, password);

            // Creo il service corretto
            ISmtpService smtpService = GetCorrectSmtpService(hostname, hostport, security);

            // Creo il client SMTP
            _smtpClient = user.CreateClient(smtpService);
        }