Forward mail via PHP
| From: | Robert Covell | Date: | Thu, 06 Feb 2003 14:57:24 +0000 |
| Subject: | Forward mail via PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-134614@lists.php.net to get a copy of this message | ||
Looking for a better solution to forward mail from an IMAP account via PHP
to another account.
Right now I am utilizing the built in imap functions (i.e.
imap_fetchstructure, imap_fetchbody, imap_header among others) to get the
individual parts and a MimeMessage class to rebuild the message. Once the
message is rebuilt I change the "To:" and then send it on. The problem is
that messages are rebuilt successfully about 95% of the time.
Can anyone suggest a better way to do this? Can I not just login to the
account get the entire message, change the "To:" and send it on it's way
leaving the message structure in tact? If so does anyone know of any
pre-existing classes to take a message as input, change the "TO:" and use
the result of this to send it out?
Thanks,
-Bob