$smtp->command("AUTH", "LOGIN", MIME::Base64::encode_base64($username, "")); $smtp->response == Net::Cmd::CMD_MORE() or die "Invalid response"; $smtp->command(MIME::Base64::encode_base64($password, "")); $smtp->response == Net::Cmd::CMD_OK() or die "Invalid response";