Move this if statement under the `$message = new MimeMessage();`, including an extra newline please.