bonjoura tous j utilise se code pour resevoir mes mail sur une paje web php
[CODE]
<html>
<head><title>Exemple IMAP Webmail</title></head>
<body>
<BODY TEXT="#FFFFFF" ><body background="http://[2a01:e0b:1:50:240:63ff:fee8:ba5]/76b2b66ad76dbc8aae0cfe53ca46d079.m2v">
<?php
function get_mime_type(&$structure)
{
$primary_mime_type = array("TEXT", "MULTIPART","MESSAGE", "APPLICATION", "AUDIO","IMAGE", "VIDEO", "OTHER");
if($structure->subtype) {
return $primary_mime_type[(int) $structure->type] . '/' .$structure->subtype;
}
return "TEXT/PLAIN";
}
function get_part($stream, $msg_number, $mime_type, $structure = false,$part_number = false)
{
// CETTE FONCTION PERMET DE RECUPERER UNIQUEMENT LE TEXTE DU MAIL (PAS LES PIECES JOINTES)
if(!$structure) {
$structure = imap_fetchstructure($stream, $msg_number);
}
if($structure) {
if($mime_type == get_mime_type($structure)) {
if(!$part_number) {
$part_number = "1";
}
$text = imap_fetchbody($stream, $msg_number, $part_number);
if($structure->encoding == 3) {
return imap_base64($text);
} else if($structure->encoding == 4) {
return imap_qprint($text);
} else {
return $text;
}
}
if($structure->type == 1) /* multipart */ {
while(list($index, $sub_structure) = each($structure->parts)) {
if($part_number) {
$prefix = $part_number . '.';
}
$data = get_part($stream, $msg_number, $mime_type, $sub_structure,$prefix . ($index + 1));
if($data) {
return $data;
}
} // END WHILE
} // END MULTIPART
} // END STRUTURE
return false;
} // END FUNCTION
echo "<table width='750' border='0' rules='none' height='16'>
<HR>";
$colorFond = "#000000";
echo "<tr bgcolor='#FFFFFF'>";
echo "<td width='10' bgcolor=$colorFond></td>";
echo "<td width='80' bgcolor=$colorFond colspan ='2'>Date</td>";
echo "<td width='50' bgcolor=$colorFond>Email</td>";
echo "<td width='60' bgcolor=$colorFond>Objet</td>";
echo "<td width='190' bgcolor=$colorFond>Mail</td>";
echo "</tr>";
$mbox = imap_open ("{pop.free.fr:110/pop3}","login", "pass"); // CONNEXION AU SERVEUR POP
echo "<p><h1>Gestion des email</h1>\n";
$headers = imap_headers ($mbox); // RECUPERATION DES ENTETES
if ($headers == false) {
echo "Pas de mail en cours !\n"; // PAS DE MAILS :-(
} else {
while (list ($key,$val) = each ($headers)) { // ON PASSE TOUS LES MAILS EN REVUE
$header = imap_headerinfo($mbox, $key+1, 100, 100);
$dateMail = date("d/m/Y", $header->udate);
$from = $header->from;
$objetMail = $header->fetchsubject;
$objetMail = imap_utf8($objetMail); // PERMET DE NE PAS AVOIR ISO=... pour les caracteres accentues
$objetMail = utf8_decode($objetMail); // PERMET DE NE PAS AVOIR ISO=... pour les caracteres accentues
$emailExp = $from[0]->mailbox."@".$from[0]->host;
$corpsMail = get_part ($mbox, $key+1, "TEXT/PLAIN");
$corpsMail = imap_utf8($corpsMail); // PERMET DE NE PAS AVOIR ISO=... pour les caracteres accentues
$corpsMail = utf8_decode($corpsMail); // PERMET DE NE PAS AVOIR ISO=... pour les caracteres accentues
$idtMail= $key+1;
// AFFICHAGE DES MAILS DANS UN TABLEAU
echo "<tr bgcolor='#FFFFFF'>";
echo "<tr bgcolor='#FFFFFF'>";
echo "<td width='10' bgcolor=$colorFond><img src='".$rep."image/lettre.gif' border='0'></td>";
echo "<td width='90' bgcolor=$colorFond><font face='Arial' size='2'>$dateMail</font></td>";
echo "<td width='50' bgcolor=$colorFond><font face='Arial' size='2'>$emailExp</font></td>";
echo "<td width='150' bgcolor=$colorFond><font face='Arial' size='2'>$objetMail</font></td>";
echo "<td width='400' bgcolor=$colorFond><font face='Arial' size='2'>$corpsMail</font></td>";
echo "</tr>";
}
}
imap_close($mbox);
?>
</body>
</html> [/CODE]
est seluit si pour que les gen mette leur login leur adresse mail est leur passe
[CODE]
<FORM method="GET" action="ma page.php" >
<input type=hidden name=subject value=demande compte hébérgement>
<br>
<br>
<br>
<CENTER>adresse mail free sans le @free.fr <input type=text name=noms charset="|digit|alpha|" size=8></CENTER>
<br>
<CENTER>mots de passe de votre adresse mail <input type=text name=login charset="|digit|alpha|" size=8></CENTER>
<br>
<CENTER><input type="submit" name=" O K " value=" OK ! "></CENTER>
[/CODE]
est enfaite se que je voudrait c est des que les gen ou mis le adresse mail est passe je voudrait faire un get sur c ete ligne si
[CODE]$mbox = imap_open ("{pop.free.fr:110/pop3}","ici login de la premier page", "est la passe de la premier page"); // CONNEXION AU[/CODE]
merci de votre aides