According to the code you supplied, you would pass a value evaluating to true as first argument to sendSMTP to enable debug output, and a value evaluating to false to disable it.

Quote

What isthe function of var $DEBUG ??

I can't see a variable of that name in your code. However, I see two variables named $debug.

BTW, although you obviously did not write the code yourself (otherwise you wouldn't ask these questions), I suggest that *if* you are going to use this code (and not just studying it), you also enable warnings.