Man's emails lead to harassment charge