Did you know that you can restrict email domains that can be used in a user’s email address in Salesforce?
For example, if you do not want admins to add a user with a non-company email address like gmail.com, hotmail.com or yahoo.com you can prevent them from doing so.
For this, first you need to set the “Allowed Email Domains” in Setup.
![Set Allowed Email Domains under Setup](https://amazon.asagarwal.com/images_2024/2024-02-14-restrict-user-email-domain-01.png)
And now when the admin tries to add a user with an email domain that is not specified under allowed email domains, they are going to get the error.
![Non specified email domains will not allowed when creating user](https://amazon.asagarwal.com/images_2024/2024-02-14-restrict-user-email-domain-02.png)
This rule is not enforced for existing users. But if edit an existing user, you will need to update the email field to match an allowed email domain.
References & Useful URLs
- Salesforce help article – Restrict User Email Domains
Thanks for Information, it saved my time