コード例 #1
0
        /// <summary>
        /// Return the 235 response code if valid, otherwise
        /// return the error.
        /// </summary>
        /// <param name="smtpProxy">The SmtpProxy being used</param>
        /// <param name="supportedAuthTypes">String array of EHLO-specified auth types</param>
        /// <returns></returns>
        public SmtpResponse Negotiate(ISmtpProxy smtpProxy, String[] supportedAuthTypes)
        {
            ISmtpAuthToken token = null;

            foreach (String authType in supportedAuthTypes)
            {
                if (authType.Equals("login"))
                {
                    token = new LoginAuthToken(_userName, _password);
                    break;
                }
            }
            if (token == null)
            {
                return(new SmtpResponse(504, DotNetOpenMail.Resources.ARM.GetInstance().GetString("unrecognized_auth_type")));
            }

            return(token.Negotiate(smtpProxy, supportedAuthTypes));
        }
コード例 #2
0
        /// <summary>
        /// Return the 235 response code if valid, otherwise
        /// return the error.
        /// </summary>
        /// <param name="smtpProxy">The SmtpProxy being used</param>
        /// <param name="supportedAuthTypes">String array of EHLO-specified auth types</param>
        /// <returns></returns>
        public SmtpResponse Negotiate(ISmtpProxy smtpProxy, String[] supportedAuthTypes)
        {
            ISmtpAuthToken token=null;
            foreach (String authType in supportedAuthTypes)
            {

                if (authType.Equals("login"))
                {
                    token=new LoginAuthToken(_userName, _password);
                    break;
                }
            }
            if (token==null)
            {
                return new SmtpResponse(504, DotNetOpenMail.Resources.ARM.GetInstance().GetString("unrecognized_auth_type"));
            }

            return token.Negotiate(smtpProxy, supportedAuthTypes);
        }