SMTP connection is closed between sending emails

server object creation has been moved to the send method