yomane51100
Messages postés69Date d'inscriptionjeudi 8 juin 2006StatutMembreDernière intervention17 septembre 2010
-
30 mai 2008 à 00:35
yomane51100
Messages postés69Date d'inscriptionjeudi 8 juin 2006StatutMembreDernière intervention17 septembre 2010
-
30 mai 2008 à 17:39
bonjoura tous j utilise se code pour resevoir mes mail sur une paje web php
<html>
<head><title>Exemple IMAP Webmail</title></head>
<?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 "Gestion des email
\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></td>";
echo "<td width='90' bgcolor=$colorFond>$dateMail</td>";
echo "<td width='50' bgcolor=$colorFond>$emailExp</td>";
echo "<td width='150' bgcolor=$colorFond>$objetMail</td>";
echo "<td width='400' bgcolor=$colorFond>$corpsMail</td>";
echo "</tr>";
}
}
imap_close($mbox);
?>
</html>
est seluit si pour que les gen mette leur login leur adresse mail est leur passe
<FORM method="GET" action="ma page.php" >
&nbsp;
&nbsp;
&nbsp;
<CENTER>adresse mail free sans le @free.fr </CENTER>
&nbsp;
<CENTER>mots de passe de votre adresse mail </CENTER>
&nbsp;
<CENTER></CENTER>
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
$mbox = imap_open ("{pop.free.fr:110/pop3}","ici login de la premier page", "est la passe de la premier page"); // CONNEXION AU