Jump to content

k-Dev

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

k-Dev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Glen Elkins for the script below.  Hope this will be of use to others aswell. (Still needs a little fine-tuning with HTML messages) [quote] <? // Set some vars $ChangeTo = "changeto@domain.com"; $ForwardTo = "forwardto@domain.com"; // Read the pipe $open_file = fopen("php://stdin","r"); $email = ""; while (!feof($open_file)) { $email .= fread($open_file,1024); } fclose ($open_file); // Take info from emai; $lines = explode("\n",$email); $from = ""; $subject = ""; $message = ""; $to = $ChangeTo; $splittingheaders = true; for ($i=0;$i<count($lines);$i++) { if ($splittingheaders) { if (preg_match("/^From: (.*)/",$lines[$i],$matches)) { if (strpos($lines[$i],"<")) { // The name is before the email $data = explode ("<",$lines[$i]); $from = substr(trim($data[1]),0,-1); } else { $from = $matches[1]; } } if (preg_match("/^Subject: (.*)/",$lines[$i],$matches)) { $subject = $matches[1]; } } else { $message .= $lines[$i]."\n"; } if (trim($lines[$i]=="")) { $splittingheaders = false; } } $message = <<< EOF $message EOF; $headers = "Content-type: text/html\n"; $headers .= "From: $from\n"; $headers .= "Return-Path: $from\n"; //$headers .= "To: $to\n"; mail ($ForwardTo,$subject,$message,$headers); ?> [/quote]
  2. [s]I am willing to Pay someone US$15 via PayPal to code a script that will do this. Needed ASAP. Email / MSN me if you are interested: [removed][/s] [EDIT]: We have found a fix for this, the offer is now closed. Thanks
  3. I guess so, to do what is required above.
  4. 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!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.