Formatting and pass tests

Fixed formatting for previous contributor commits. Fixed failing tests
due to new commits and PHPMailer behavior changes.