It looks like spaces were removed from the code somehow. I'm not sure what would cause this.
For instance you have:
$Email->From =""
but the server behavior adds code:
$Email->From = ""
There are spaces missing after commas and after equal signs throughout the code.
This could explain the issue you have with recordsets disappearing as well. Do you know what is removing the spaces? I can update the extension to allow for the spaces to be removed so you won't run into this issue, but I'm interested to know what might be removing them in the first place.