Trim whitespace from input (fixes #1)
Tested and working.
For checking if email/domains are valid, I had a branch somewhere that uses regex for this, but I dont know where it went. Anyway it wasnt working very reliably. Feel free to open a new issue for that.