20
It is good,because we know it seems to come from the mail.
It is bad, because it is not solved yet.
(I tought to indicate line 266 for easier retrieval of the right bracket, but it did confuse you in stead.)
Can you comment out line 267 and see what happens?
$GLOBALS['xoopsTpl']->append('confirm', $message);
Then retry with commenting out line 226
XoopsUserUtility::sendWelcome($newuser);
Did you try already an alternative mail delivery function as sendmail or SMTP in the mail preferences?