After change to strict mode, this file got an error "mailOptions is not defined" this fixes the issue by making the call strict mode compatible as the variable mailOptions had not been declared.