Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Having problem with parsing the bounced email
Old 11-25-2007, 08:06 PM Having problem with parsing the bounced email
Junior Talker

Posts: 3
Trades: 0
Hi! I created a bounced email management system. All bounced email are returned to a specified email and from this email it will be redirected to a script that will parse the bounced email so that I can be able to get the recipients address and the reason why it is bounced. It perfectly redirected to my script but the problem is when I loop over it, it doesn't store to a variable ($strReason). Here's the code:

// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";

while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);

// handle email
$lines = explode("\n", $email);
$strReason = "";

for ($x = 0; $x < count($lines); $x++){
$strReason .= $lines[$x];
}

// Store bounced email to database
$sql = "INSERT INTO tbl_bounced_email(Reason) VALUES('$strReason')";
$r = mysql_query($sql, $link) or die (mysql_error().' '.$sql);

but when i set the loop to 16 only, it stores the message to $strReason
for ($x = 0; $x < 16; $x++){
$strReason .= $lines[$x];
}
jeboy25 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-28-2007, 09:02 PM Re: Having problem with parsing the bounced email
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
Next time use PHP blocks around your code please. This part here:
PHP Code:
$fd fopen("php://stdin""r"); 
I've never heard of a php protocol before, is that something you created? try just using the path to stdin.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to Having problem with parsing the bounced email
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10157 seconds with 12 queries