Replace Email Id text with * before @ and after first 2 character in SQL

Replace Email Id text with * before @ and after first 2 character in SQL

Here Original Table Email Ids

admin@gmail.com
amos@mailinator.com
admin@gmail.com


SELECT  STUFF(EMAILID,3,PATINDEX('%@%',EMAILID)-3,
REPLICATE('*',
LEN(
SUBSTRING(EMAILID,3,PATINDEX('%@%',EMAILID)-3)
)
)
) AS EMAILID FROM UserTable

Output :

ad***@gmail.com
am**@mailinator.com
ad***@gmail.com