Is it legal to ship an envelope of glitter to somebody (e.g. Ship Your Enemies Glitter)?
If it's not, what are the potential penalties?
This may constitutes harassment, which is against the law in most jurisdictions. But what counts as legal harassment is not obvious. Taking Washington state as an exemplar, RCW 9a.46, the stated intent of the law is to criminalize "repeated invasions of a person's privacy by acts and threats which show a pattern of harassment designed to coerce, intimidate, or humiliate the victim", and mailing glitter in order to annoy a person would not match that desideratum. In Washington, the law is limited to threats of physical harm or restraint or the intent to "substantially harm the person threatened or another with respect to his or her physical or mental health or safety". There is no legal standard for judging what constitutes substantial harm to mental health.
California defines "harassment" in its civil code as
unlawful violence, a credible threat of violence, or a knowing and willful course of conduct directed at a specific person that seriously alarms, annoys, or harasses the person, and that serves no legitimate purpose. The course of conduct must be such as would cause a reasonable person to suffer substantial emotional distress, and must actually cause substantial emotional distress to the petitioner.
More words, but still it is left to the jury to decide whether an act causes severe emotional distress. Emphasis was added in the text to highlight important elements missing from sending glitter to someone for the purpose of annoying. In general, annoying someone is not against the law, but repeatedly and severely annoying someone could be.