Updating mail sending code.