Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Web Hosting Services

Notices

Reply
 
Thread Tools
  #1  
Old 12-24-2006, 01:39 AM
k-Dev k-Dev is offline
Hatchling Croc
 
Join Date: Dec 2006
Posts: 1
Exclamation Help with Piped PHP Email Forwarder Script

Hey all

I need a PHP script that will receive any email (via Email Piping setup in cPanel), then change the "TO" field of the email (to a variable predefined in the script), then forward the MODIFIED email to another email address (also predefined in the script).


Example:

================================================== =

Predefined Variables:
$ConvertTo = "NEW_to_ADDRESS@domain.com" // NEW 'TO' address
$ForwardTo = "forward_to@domain.com" // Address to FORWARD email to


The message below is received by "original_recipient@domain.com" and Piped to "http://mydomain.123/EmailConvertScript.php"

--- Original Message: ---
From: original_sender@domain.com
To: original_recipient@domain.com
Body: 12345
-------------------------


The "TO" Field would then be modified, and the modified message forwarded to "forward_to@domain.com"

--- Modified Message: ---
From: original_sender@domain.com
To: NEW_to_ADDRESS@domain.com
Body: 12345
-------------------------

================================================== =


Note: ONLY the 'TO' Field is modified, all other headers MUST remain original/intact.


Anyone have an idea of how I could achieve this ??


Reason:

I have an email account (email@domain.com) that will ONLY accept emails sent to it DIRECTLY (sent to: email@domain.com).

I need to be able to setup a 'catchall' email account on another domain, then have it forward all emails to my "email@domain.com" address.

This is the only way around it.



Any help would be much appeciated, Thanks!!
Reply With Quote
  #2  
Old 12-29-2006, 06:02 AM
swexpert swexpert is offline
Baby Croc
 
Join Date: Dec 2006
Posts: 53
Default Re: Help with Piped PHP Email Forwarder Script

Does your "other mail" support IMAP? IN that case you could do that. Otherwise, you will have to read periodically from the other mail and forward it to current mail. This can also be achieved via DNS (mail forwarding)

Regds
IJ
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 04:02 AM.