[personal profile] robinbobin
[livejournal.com profile] lleo жалуется

Леонид Каганов:        
Здесь есть техническая деталь: надо обрабатывать приходящий email. А как это сделать на PHP, я пока не представляю. Созидатель сказал, что это просто, и когда-нибудь он расскажет.

http://lleo.aha.ru/dnevnik/2007/03/20.html

все просто.

Для наводки кидаю кишки боевого робота, который будит меня  по приходу e-maila от клиента c правами будить меня



$mbox = imap_open ("{mymailserver.com:110/pop3}INBOX", "budilnik@mymailserver.com", "parol")
        or die("can't connect: ".imap_last_error());

$check = imap_mailboxmsginfo($mbox);

if($check) {
    print "Date: "    . $check->Date    ."\n" ;
    print "Driver: "  . $check->Driver  ."\n" ;
    print "Mailbox: " . $check->Mailbox ."\n" ;
    print "Messages: ". $check->Nmsgs  ."\n" ;
    print "Recent: "  . $check->Recent  ."\n" ;
    print "Unread: "  . $check->Unread  ."\n" ;
    print "Deleted: " . $check->Deleted ."\n" ;
    print "Size: "    . $check->Size    ."\n" ;
} else {
        print "imap_check() failed: ".imap_last_error(). "\n";
        exit;
}


if ($check->Nmsgs > 0) {
              // delete this message
        imap_delete ($mbox, 1);
        imap_expunge ($mbox);

                // запустить winamp
        exec ("start gromko.m3u");
}

Date: 2007-03-21 10:05 am (UTC)
From: [identity profile] paskas.livejournal.com
Какой ужас нах!
И че, клиенты бывают такие, что надо ночью подрываться?

Date: 2007-03-21 10:08 am (UTC)
From: [identity profile] robinbobin.livejournal.com
не. я днем сплю.

Profile

robinbobin

December 2016

S M T W T F S
     1 2 3
45 6 7 8 910
1112 13 14 15 16 17
18192021 22 23 24
25262728293031

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 24th, 2025 12:55 pm
Powered by Dreamwidth Studios