Correcting check for sendEmail variable
Fixing typo
Emailing codes to recipient automatically
Varying confirmation messages depending on mailing success