Advertisement
Gheecco

IsValidEmail

Apr 28th, 2020
32,951
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.82 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement