Does this code actually send emails?

More important than the above comment is that it seems that you are not exporting the expected functionality (sendMail) :|