note 95133 modified in function.imap-body by danbrown

From: Date: Fri, 15 Jun 2012 15:57:27 +0000
Subject: note 95133 modified in function.imap-body by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188631@lists.php.net to get a copy of this message
Simple example on how to read body message of the recent mail.&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;$imap = imap_open(&#34;{pop.example.com:995/pop3/ssl/novalidate-cert}&#34;, &#34;username&#34;, &#34;password&#34;);&#13;&#10;&#13;&#10;if( $imap ) {&#13;&#10; &#13;&#10; //Check no.of.msgs&#13;&#10; $num = imap_num_msg($imap);&#13;&#10;&#13;&#10; //if there is a message in your inbox&#13;&#10; if( $num &#62;0 ) {&#13;&#10; //read that mail recently arrived&#13;&#10; echo imap_qprint(imap_body($imap, $num));&#13;&#10; }&#13;&#10;&#13;&#10; //close the stream&#13;&#10; imap_close($imap);&#13;&#10;}&#13;&#10;?&#62; --was-- Simple example on how to read body message of the recent mail. <?php $imap = imap_open("{pop.example.com:995/pop3/ssl/novalidate-cert}", "username", "password"); if( $imap ) { //Check no.of.msgs $num = imap_num_msg($imap) //if there is a message in your inbox if( $num >0 ) { //read that mail recently arrived echo imap_qprint(imap_body($imap, $num)); } //close the stream imap_close($imap); } ?> http://php.net/manual/en/function.imap-body.php

« previous php.notes (#188631) next »