Fixing php mail

I was notified that the php mail version part of the script wasn't
working correectly on sending mail from realys. So, I am trying to fix
it now.