Added support for multiple IP addresses

Also improved how the script handles emailing. If it can't do SMTPS it
will try regular SMTP instead of just crashing out.