Current location: Hot Scripts Forums » Programming Languages » PHP » Help needed with E-mail Pipe Script


Help needed with E-mail Pipe Script

Reply
  #1 (permalink)  
Old 11-03-04, 08:12 PM
SurfTurtle SurfTurtle is offline
New Member
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Help needed with E-mail Pipe Script

I am a complete newbie with PHP. I searched the web and put together some pieces of code:
PHP Code:

#!/usr/bin/php

<?php
// read from stdin
$fd fopen("php://stdin""r");
$email "";
while (!
feof($fd)) {
    
$email .= fread($fd1024);
}
fclose($fd);

$email ereg_replace('old_text, 'new_text', $email);

$file = "inbox";
$handle = fopen($file, '
a');
fwrite($handle, $email);
fclose($handle);

?>
The this script does exactly what I want which is to change some specific text and then add to the file 'inbox'.
The problem is that even though the e-mail is recieved and saved in the 'inbox' file after replacing the specified text the sender of that e-mail gets a 'mail not delivered' message becuase when the script is run the fwrite() returns the number of bytes written which sendmail thinks is an error and sends a 'mail not delivered' message back to the sender.

Does anyone know how to turn off the bytes written feature of fwrite() or another function which does the same job but does not return any data?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dating script needed: MissRikka Job Offers & Assistance 14 06-21-06 08:52 PM
eBay / PayPal auction payment script needed Synthetic Job Offers & Assistance 3 03-06-06 12:40 PM
Artist pages script needed SR_Ben Script Requests 0 07-09-04 03:30 PM
will pay. php script needed. upload, resize, & email jamjammo Script Requests 4 02-29-04 09:30 PM
Developer needed to database pre-written script twastudios Script Requests 0 11-19-03 02:16 PM


All times are GMT -5. The time now is 07:13 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.