Changing the PEAR settings won't affect the NEXT_NUM_FILE operation.
So, my guess is you modified a copy of FormMail that was not identical to the one previously installed on your system, and when you uploaded it, the differences caused the new problem.
I recommend you restore from the backup you took (I hope you did), confirm that operation is back the way it was, then download that almost-working copy and make the changes to the PEAR settings in that.
Alternatively, we can look directly at the new problem. In this case, please send access details to your server using this secure form: