Fixed email sending. Also added exitcode when launched without proper arguments.