SHARE
TWEET

IsValidEmail

Gheecco Apr 28th, 2020 (edited) 4,791 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stock IsValidEmail(const email[]) //controllo E-Mail.
  2. {
  3.     new Provider[20], at_pos = strfind(email, "@", true) + 1;
  4.     if(email[0] == '@' || at_pos == -1)
  5.     {
  6.         return false;
  7.     }
  8.  
  9.     strmid(Provider, email, at_pos, strlen(email));
  10.  
  11.     static const providers[][] = //Provider Email validi.
  12.     {
  13.         "hotmail.com",
  14.         "hotmail.it",
  15.         "live.com",
  16.         "live.it",
  17.         "outlook.com",
  18.         "outlook.it",
  19.         "libero.it",
  20.         "gmail.com",
  21.         "yahoo.com",
  22.         "virgilio.it",
  23.         "email.it",
  24.         "protonmail.com",
  25.         "protonmail.ch"
  26.     };
  27.  
  28.     for(new i = 0; i < sizeof(providers); i ++)
  29.     {
  30.         if(!strcmp(Provider, providers[i], true))
  31.         {
  32.             return true;
  33.         }
  34.         else continue;
  35.     }
  36.     return false;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top