A man has been jailed for sending threatening emails to a Hampshire MP which caused her to "constantly look over her shoulder".