Beispiel #1
0
        public bool emailValidation(string email)
        {
            bool msg = false;

            try
            {
                string address = new MailAddress(email).Address;
                if (address.IndexOfAny(".".ToCharArray()) != -1)
                {
                    if (!address.Contains("..") || !address.Contains(".@") || !address.Contains("@.") || !address.Contains("._."))
                    {
                        if (!address.EndsWith("."))
                        {
                            msg = true;
                        }
                    }
                }
                else
                {
                    msg = false;
                }
            }
            catch (Exception ex)
            {
                msg = false;
            }

            return(msg);
        }
Beispiel #2
0
        public bool isEmailValid(string email)
        {
            bool msg = false;

            try
            {
                string EMAIL = new MailAddress(email).Address;
                if (!EMAIL.EndsWith("."))
                {
                    if (!EMAIL.Contains("..") || !EMAIL.Contains("@.") || !EMAIL.Contains(".@") || !EMAIL.Contains("._.") || !EMAIL.Contains("_.") || !EMAIL.Contains("._"))
                    {
                        msg = true;
                    }
                }
            }
            catch (Exception ex)
            {
                msg = false;
            }

            return(msg);
        }
Beispiel #3
0
        public bool isEmailValid(string email)
        {
            bool valid = false;

            try
            {
                string address = new MailAddress(email).Address;
                if (!address.EndsWith("."))
                {
                    if (!address.Contains("..") || !address.Contains("@.") ||
                        !address.Contains(".@") || !address.Contains("._.") ||
                        !address.Contains("._") || !address.Contains("_."))
                    {
                        valid = true;
                    }
                }
            }
            catch (Exception ex)
            {
                valid = false;
            }

            return(valid);
        }