Hi,
Yeah I'm sure I didn't change nothing in class.email.php I even re-uploaded all files to try. Stupid thing I had an exact copy running just fine on other server so I think it is related to server settings (this error started when I upgraded to mysql 5.1 and php 5.3; however the other server which was running exact copy was also running that).
I checked the file myself also but it just seems to be a problem how that function is called.
The change I made in mysql class were simple, instead of using the osticket method to connect I edited it so it uses a function to execute queries from my own system.