It’s perfectly legal to send anonymous emails. However, any emails used for illegal activity could be considered illegal, whether they are anonymous or not.