catch email exceptions and configure smtp properly