jabberを使用するには、ライブラリXMPPHPを使用します。
その他のコードとコメント...
まず、設定で通知ヘルメットの場所と場所を説明します
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
-
// config.php $jabberServer = 'jabber . ru' ; // - $jabberPort = 5223 ; // $jabberLogin = 'mailnotify' ; // $jabberPassword = ' 123 ′ ; // $jabberID = “you @ jabber . ru” ; // JabberID $email = “yourEmail” ; // $emailPassword = “emailPassword” ; //
メインスクリプトコード:
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
-
include_once ( 'config . php' ) ; $mbox = imap_open ( “ { pop . gmail . com : 995 / pop3 / ssl / novalidate - cert } INBOX” , $email , $emailPassword ) ; $recentMails = imap_num_recent ( $mbox ) ; if ( $recentMails > 0 ) { include_once ( “XMPPHP / XMPP . php” ) ; $notifySent = false ; $jabberConnection = new XMPPHP_XMPP ( $jabberServer , $jabberPort , $jabberLogin , $jabberPassword , 'xmpphp' , $jabberServer , $printlog = false , $loglevel = LEVEL_ERROR ) ; $jabberConnection -> useSSL ( true ) ; $jabberConnection -> connect ( ) ; $jabberConnection -> processUntil ( ' session_start ' ) ; $jabberConnection -> presence ( ) ; $jabberConnection -> message ( $jabberID , ' ' . $recentMails . ' , ' ) ; for ( $i = 1 ; $i <= $recentMails ; $i ++ ) imap_fetchbody ( $mbox , $i , 1 ) ; $jabberConnection -> disconnect ( ) ; }
それだけです、簡単な警告灯が用意されています。 少しインタラクティブ性を追加することもできます。たとえば、ヒキガエルで直接文字を読むことができます。次のようなデザインを追加するだけです。
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
-
$notifySent = false ; while ( ! $jabberConnection -> isDisconnected ( ) ) { $loads = $jabberConnection -> processUntil ( array ( 'message' , ' session_start ' ) ) ; foreach ( $loads as $event ) { $pl = $event [ 1 ] ; switch ( $event [ 0 ] ) { case “message” : if ( $pl [ 'body' ] == ' ! read' ) $jabberConnection -> message ( 'user @ jabber . ru' , getEmails ( $mbox , $recentMails ) ) ; elseif ( $pl [ 'body' ] == ' ! exit ' ) $jabberConnection -> disconnect ( ) ; break ; default : if ( ! $notifySent ) { $jabberConnection -> message ( 'user @ jabber . ru' , ' ' . $recentMails . ' , ' ) ; $notifySent = true ; } break ; } }
コマンドとハンドラーを追加するだけで、このようなジャバーボットを取得できます。