Updating mail sending code. Still is blocked by gmail sometimes.