a bit more error checking on toEmail
Merge pull request #563 from mikedewar/email

a bit more error checking on toEmail