RE: [PHP] Checking mail with `mail`
| From: | esctoday.com | Wouter van Vliet | Date: | Tue, 30 Sep 2003 09:30:29 +0000 |
| Subject: | RE: [PHP] Checking mail with `mail` | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164355@lists.php.net to get a copy of this message | ||
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 wouter@brandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 2 wouter@brandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 3 wouter@brandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 4 wouter@brandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 5 wouter@brandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 6 wouter@brandtstraat. Tue Sep 30 11:17 24/786 "test"
> Message 1:
> From wouter@brandtstraat.mine.nu Tue Sep 30 11:17:32 2003
> Date: Tue, 30 Sep 2003 11:17:31 +0200
> From: Wouter van Vliet <wouter@brandtstraat.mine.nu>
> To: wouter@brandtstraat.mine.nu
> 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:dan@phiffer.com]
Sent: Friday, September 26, 2003 1:05 AM
To: php-general@lists.php.net
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