Updated to support SMTP servers that require authentication.