Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
How to validate only working Email in JavaScript?

How to validate only working Email in JavaScript? Actually, I want only working email excluding (@gmail.com, @outlook.com, @hotmail.com, @yahoo.com etc). I want only working emails like abc@stack.com etc.

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

This code is also working!

let text = "abc@hotmail.com";
let domain = text.substring(text.lastIndexOf("@"));
if(domain == "@gmail.com" || domain == "@yahoo.com" || domain == "@hotmail.com" || domain == "@outlook.com"){
    console.error("Wrong format")
}else{
    console.log("working email")
}

about 4 years ago · Juan Pablo Isaza Denunciar

0

One way is to get the domain part from the email, and check it against the list of personal email domains:

const workingEmailValidator = email => 
    !['gmail', 'hotmail', 'yahoo', 'outlook'].includes(email.split('@')[1].split('.')[0])

console.log(workingEmailValidator('xyz@sss.com'))
about 4 years ago · Juan Pablo Isaza Denunciar

0

I use my own function after checking if email is valid then you can check if it is work email or not :

const notAllowed = ["gmail.com", "email.com", "yahoo.com", "outlook.com"];
 function check(email) {
    const lastPortion = email.split("@")[1].toLowerCase();
     if (notAllowed.includes(lastPortion)) {
          console.log("Please enter work email");
          return false;
     }
     return true;
}
check("abc@paiman.com");
check("abc@gmail.com.com");
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda