Validate Email Address





-7
Date Submitted Thu. Oct. 13th, 2005 7:34 PM
Revision 1 of 1
Coder mattrmiller
Tags "Email Address" | CPlusPlus | Validate
Comments 4 comments
Validate Email Address
bool ValidateEmail(CString strEmail)
{
        // Declare variables
        int nAt, nPeriod;
       
        // Find '@' sign
        nAt = strEmail.Find('@');
        if(nAt == -1)
        {
                return false;
        }

        // Trim left side
        strEmail.Delete(0, nAt);

        // Find '.'
        nPeriod = strEmail.Find('.');
        if (nPeriod == -1)
        {
                return false;
        }

        return true;
}
 

Matthew R. Miller

www.bluecreststudios.com
=================
Matthew R. Miller

http://bluecreststudios.com
http://www.codeandcoffee.com

Comments

Comments .@ is now a valid email?
Tue. Sep. 5th, 2006 11:09 AM    Scripter ctiggerf
Comments Reverse DNS
Fri. Sep. 22nd, 2006 12:21 AM    Scripter sehrgut
Comments Wow...
Thu. Aug. 3rd, 2006 12:19 PM    Helper bobbyrward
Comments Nope
Wed. Aug. 23rd, 2006 8:32 AM    Beginner billism

Voting