On 2/3/06, Gordon Stewart <[EMAIL PROTECTED]> wrote:
> PROBLEM:-
>
> During my testing, I found my 'email-in' script - was working (its seperate 
> from my non-working script) - However, it leaves 1 message on the server each 
> time.
>
> Ive tried adding, or subtracting the index... - However still get the sdame 
> (or similar) errors
>
> - I'll send you the code details tonight - when I get home...

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


Heres furether - My code used (extracted from bigger script...)

-----------------------------------

I *think* ive fixed it - However im now getting another error -
"Invalid quoted-printable sequence"

<?php
error_reporting(E_ALL);
echo "<PRE>\n";
echo "Logging into server\n";
$server = "mail.domain.com";
$server = "{".$server.":143/notls"."}"."INBOX";
echo "Using NEW password / Userid.\n\n";
$user = "USER";
$password = "PASSWORD";

$link=imap_open("$server",$user,$password);
if ( $link === false ) {
       exit ("Can't connect: " . imap_last_error() ."\n");
}
$headers=imap_headers($link);
$t=0;
$temp=count($headers);
echo "HEADER COUNT - '$temp'<BR>\n";

   while (list ($key, $val) = each ($headers)) {
       echo "Z '$key' -- '$val'<BR>\n\n";
      $t++;
   }

echo "Found $t messages\n";

if ($t>0){

echo "\n\nSTARTING SCAN MESSAGEs - TOTAL = $t\n";

for($x=1; $x < count($headers); $x++) {
    $idx=$x;

$REGISTER=0;
$VOTE=0;

echo "\n*****\nREADING NEW MESSAGE $idx of $t\n\n";

$GOT=0;

echo "\nBODY4- - $idx<BR>\n\n";

echo "X = '$x' - '$idx' - LINK '$link'\n";

$test =imap_fetchheader($link,$idx);

$body1 = imap_body($link,$idx);

$mymsg = imap_qprint ( $body1 );
$body1=$mymsg;

$pieces1 = explode("\n", $body1);

$pieces = explode("\n", $test);

$pieces2 = explode("\n", $test);

echo "\n*****\n\n124<BR>\n\n\n\n";


echo "\n\nScanning 1\n";

foreach ($pieces as $key=>$value) {
 $value=trim($value);
echo "$value\n";
}
echo "\n\n\n============\n\n\n";
}
#imap_expunge($link);  // delete all messages marked for deletion
imap_close($link);
}
echo "END\n\n";
?>

------------------------

There are a 'few' variables that are un-used in the above - Ive
extracted it from a bigger script (but it still produces the above
error, for 1 message.....)..

I thought that this line :- $mymsg = imap_qprint ( $body1 );

was supposed to make it into normal "printable" - text...

Or am I using incorrect code....

at the time of writing this, there are 2 emails on the server - The
1st one is complete - No errors - the second one shows "Invalid
quoted-printable sequence"

Thanks...




--
G
Yahoo Archives by email = Yes
http://groups.kwister.com/owners.php#add
NZ community groups - [EMAIL PROTECTED]


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to