It can't work if you change the sendmail path, you obviously can't use the sendmail script from outside the server without any change to sendmail/qmail. Doing more research, I found that the best solution would probably be not to use the mail() function but to build an smtp connection with the qmail program. If anyone found a better solution, let me know.
The smtp connection to an outside mail server should definitively be implement in php. 🙁