Created
August 6, 2010 11:36
-
-
Save pastak/511202 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pop = new Net_POP3(); | |
$pop->connect($host, $port); | |
$login=$pop->login($user, $pass, USER); | |
$messages = $pop->getListing(); | |
if($login){ | |
$num=$pop->numMsg(); | |
$headers=$pop->getParsedHeaders($num); | |
$from=$headers["From"]; | |
$subject=$headers["Subject"]; | |
$mes=$from.'から「'.$subject.'」が届いてるよ'; | |
echo mb_convert_encoding($mes, 'SHIFT-JIS', 'EUC-JP,SJIS,ASCII,JIS,UTF-8'); | |
} | |
$pop->disconnect(); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment