I need a php script that will take an object containing the headers and body of an email, and forward that email using the standard php email functionality.
To ensure the email is received, the script must strip any unwanted headers (such as those inserted by the outgoing server or virus checking - view the source code of any email message to see them), and rewrite the to, from, reply to etc. headers to match the forwarding address. Any attachments contained within the original email must also be contained in the forwarded email.