//但是如果真的要写WEBMAIL,那么要考虑的东西就不止这些了……孤狼
login.php3
if (!$PHP_AUTH_USER) {
Header("WWW-authenticate: basic realm="邮件客户检查"");
Header("HTTP/1.0 401 Unauthorized");
} else {
$MYDIR=ereg_replace("/[^/]+$","",$PHP_SELF);
Header("Location: $SERVER_NAME$MYDIR/messages.php3");
}
?>
这个进行用户检查并将用户引导到用户邮件页.
messages.php3
$MAILSERVER="{localhost/imap}";
$link=imap_open($MAILSERVER,$PHP_AUTH_USER,$PHP_AUTH_PW);
$headers=imap_headers($link);
for($x=1; $x $idx=($x-1);
echo "$headers[$idx]
";
}
?>
通过验证后连接到IMAP服务器$MAILSERVER
然后在取得邮件列表,并创建阅读邮件的连接
view.php3:
$MAILSERVER="{localhost/imap}";
$link=imap_open($MAILSERVER,$PHP_AUTH_USER,$PHP_AUTH_PW);
$header=imap_header($link,$num);
echo "From: $header[fromaddress]
";
echo "To: $header[toaddress]
";
echo "Date: $header[Date]
";
echo "Subject: $header[Subject]
";
echo imap_body($link,$num);
?>
view.php3打开IMAP连接并取得邮件头部信息并显示
这Only是一个拿来完完的小程序,要完整的自己去写啦!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
