Location: PHPKode > scripts > MailDog > maildog/reply.html
<?
include('defaults.php3');

if ( empty($server) || empty($account) || empty($password) ) {
        Header("Location: $MAILDOG");
        exit;
}
?>
<meta charset="iso-8859-7">
<body bgcolor="#eeeeee">
<font face=arial>
<?

$msg_number=implode($argv," ");


$mbox = imap_open("{$server:143}INBOX",$account,$password,OP_READONLY);

$status=imap_check($mbox);
$num_msg=$status->Nmsgs;

$header=imap_header($mbox,$msg_number,1);
$from   =$header->fromaddress;
$subject="Re:" . $header->subject;
$replyto =$header->reply_toaddress;
if ( empty ($replyto) ) {
	$replyto =$header->toaddress;
}
if ( ereg("\"",$replyto) ) {
	$replyto=ereg_replace("\"","",$replyto);
}


$body    = "On " . date("D d M Y",$header->udate) . " $header->fromaddress said:\n\n\n>";

#quote chars
$body   .= ereg_replace("\n","\n>",imap_body($mbox,$msg_number));

#remove last >
$body   = ereg_replace(">$","",$body);

imap_close($mbox);

?>

<table bgcolor="#006699" width=100%>
<tr>
	<td align=center><font face=arial color="white">
		Message Reply / ÁðÜíôçóç Ìçíýìáôïò
	</td>
</tr>
</table>

<center>
<form action="sendmail.html" method=post>
<table border=0 cellpadding=3 cellspacing=7 width="100%">
 <tr>
        <td align=right><font Face=arial>From:</td>
	<td><font Face=arial>
<?
	print "<input name=\"email\" value=\"$account@$server\" size=40>"; 
?>
	</td>
</tr>
 <tr>
        <td align=right>
		<font Face=arial> To:
	</td>
	<td><font Face=arial>
<?
	if ($replyto == "" ) {
 		print "	<input name=\"to\" size=40>"; 
} else{
 		print "<input name=\"to\" value=\"$replyto\" size=40>"; 
}

?>
	
	</td>
</tr>
 <tr>
       <td align=right>
		<font Face=arial> Subject:
	</td>
	<td><font Face=arial>
<? print "	<input name=\"subject\" value=\"$subject\" size=40>";?>
</td>
</tr>
 <tr>
        <td valign=top><font Face=arial>
	Message:</font>
	</td>
	<td>
	<textarea name="message" rows=13 cols=70><? print "$body"; ?></textarea>
	</td>
</tr>
</table>
<input type="Submit" value="                    Send it                    ">
<br><br>
Return current item: MailDog