Don't know if is still useful for you, but in order to send email from ipage using php you need to set the "From: " field in the mail function as 'From: /usr/sbin/sendmail'."\r\n".
So in your case the variable $from would be $from = 'From: /usr/sbin/sendmail'."\r\n"
I myself tried this code and it fixed the problem.
Best regards.