added arg that prints to the console instead of sending an email (mostly for test purposes)
customisable SMTP server setting