By advising you something like this

      2 <?php
      3 exec('echo "p 1" | mail', $Lines);
      4
      5 foreach($Lines as $Line) {
      6         print '> '.$Line."\n";
      7 };
      8 ?>

Would I apply for the bonus points? It would generate output similar to

        > Mail version 8.1 6/6/93.  Type ? for help.
        > "/var/spool/mail/wouter": 6 messages 6 unread
        > >U  1 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
        >  U  2 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
        >  U  3 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
        >  U  4 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
        >  U  5 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
        >  U  6 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
        > Message 1:
        > From [EMAIL PROTECTED]  Tue Sep 30 11:17:32 2003
        > Date: Tue, 30 Sep 2003 11:17:31 +0200
        > From: Wouter van Vliet <[EMAIL PROTECTED]>
        > To: [EMAIL PROTECTED]
        > Subject: test
        >
        > #!/usr/bin/php -q
        > <?php
        > exec('echo "p 1" | mail', $Lines);
        >
        > foreach($Lines as $Line) {
        >       print '> '.$Line."\n";
        > };
        > ?>
        >
        > Saved 1 message in mbox
        > Held 5 messages in /var/spool/mail/wouter 

(in this test, I mailed the contents of my script to myself)

Hope it helps ya,
Wouter

-----Original Message-----
From: Dan Phiffer [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 26, 2003 1:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Checking mail with `mail`

Is it practical to check for new mail from PHP using the UNIX mail utility?
This would mainly be used to check for bounces from large mailings. Bonus
points for anyone who can find me an article explaining the technique.

Thanks!
-Dan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to