Generate a random email in Angular JS

Asked

Viewed 33 times

0

Generate a random email

I need to generate a random email, for when I will create the registration of a user on my system, every time I insert a new user I need to generate this email.

Below the code snippet where I will launch the generated random email.

 formGroup.email = "emailrandômicoaqui",

It needs to be like this: [email protected]

Because it was a business rule that we created, that the user’s email will be set in another form from another part, by the administrator, so at the time of registration, we do not let an email be repeated and we do not let it go empty. That’s why I need to generate e-mail.

  • Does mail have a domain? or is it basically an Random string and only one that you look for?

  • And there’s no rule to generate that? It just has to be Random? Email can be something like [email protected]?

  • Yes friends, it can be anything random in the style [email protected], I really appreciate the help. @Sergio

  • @jbueno has rule yes, it has to be in the valid pattern, because the loopback does not let pass in invalid format.

  • Then just generate a guid/uuid. Here’s how to create this in Javascript in this question

  • @jbueno thanks, I think this will serve, I will give a debug in the code and test here

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.