Created
June 18, 2012 04:11
-
-
Save allen501pc/2946795 to your computer and use it in GitHub Desktop.
POP3 Authentication for NCHU.
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
<?php | |
/* Program: Authenticate E-Mail for NCHU by POP3 | |
* Author: Jyun-Yao Huang (Allen, [email protected]) | |
* Date: 18th June, 2012 | |
*/ | |
list($user,$domain) = @explode("@",$_POST['email']); | |
//list($user,$domain) = @explode("@","your @mail.nchu.edu.tw here"); | |
$answer=""; | |
$password= $_POST['emailpassword']; | |
//$password= "your test password here"; | |
$errno=0; | |
$errstr=""; | |
$fp = @fsockopen($domain,110,$errno, $errstr,10); | |
$answer1=@fgets($fp,128); | |
@fwrite($fp,"user $user\n"); | |
$answer=@fgets($fp,128); | |
@fwrite($fp,"pass $password\n"); | |
$answer=@fgets($fp,128); | |
@fclose($fp); | |
// If the authentication is true, then output "true", or "false". | |
if(strlen(stristr($answer,"OK"))>0) | |
echo "true"; | |
else | |
echo "false"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment