Imap Problem

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Postby mf_2 » 20. June 2004 13:11

Ich hab auch das Problem mit der undefined function.

Ich hab im phpinfo die Zeile "IMAP c-Client Version 2001", aber diese zeile mit dem enabled fehlt! Wie aktiviere ich diese funktionen ( so dass die enabled-zeile im phpinfo steht )?

danke schon im voraus,

mf_2
mf_2
 
Posts: 20
Joined: 09. February 2004 19:54

Postby Wiedmann » 20. June 2004 13:48

Ich hab im phpinfo die Zeile "IMAP c-Client Version 2001",

Das langt ja auch schon.
Wenn dieses angezeigt wird, kannst du die IMAP - Funktionen benutzen.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mf_2 » 20. June 2004 14:37

na eben leider nicht.
ich bekomm immer noch nen "call to undefined function" fehler
hilfe!
mf_2
 
Posts: 20
Joined: 09. February 2004 19:54

Postby Wiedmann » 20. June 2004 14:42

Also bei mir zeigt der auch kein "enabled" an und es tut. Dadurch das IMAP überhaupt aufgeführt wird, sieht man ja das die Erweiterung geladen wurde (sonst hättest ja schon beim Apache Start einen Fehler).

Die com - Erweiterung hat z.B. auch kein "enabled".

Wie heißt denn die Funktion (Codeausschnitt)?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mf_2 » 20. June 2004 21:41

Die funktion heisst imap_open().

Hier der code:

Code: Select all
<?php
$mbox = imap_open("{localhost:110}", "admin", "");

echo "<h1>Mailboxes</h1>\n";
$folders = imap_listmailbox($mbox, "{localhost:110}", "*");

if ($folders == false) {
   echo "Call failed<br />\n";
} else {
   while (list ($key, $val) = each($folders)) {
       echo $val . "<br />\n";
   }
}

echo "<h1>Headers in INBOX</h1>\n";
$headers = imap_headers($mbox);

if ($headers == false) {
   echo "Call failed<br />\n";
} else {
   while (list ($key, $val) = each ($headers)) {
       echo $val . "<br />\n";
   }
}

imap_close($mbox);
?>


und die fehlermeldung passiert in der 2. zeile ( ... in line 2 ).
mf_2
 
Posts: 20
Joined: 09. February 2004 19:54

Postby Wiedmann » 21. June 2004 10:54

Hm, seltsam. Wenn IMAP bei phpinfo() aufgeführt wird, dann hätte dein Code auch funktionieren müssen.

Was gibt den folgender Script bei dir aus?
Code: Select all
<?php
   echo "<pre>\n";
   if (extension_loaded('imap')) {
      echo "IMAP ist geladen!\n";
      print_r(get_extension_funcs('imap'));
   } else {
      echo "IMAP ist nicht geladen!\n";
   }
   echo "</pre>\n";
?>
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mf_2 » 21. June 2004 20:40

Das wird ausgegeben:

IMAP ist geladen!
Array
(
[0] => imap_open
[1] => imap_reopen
[2] => imap_close
[3] => imap_num_msg
[4] => imap_num_recent
[5] => imap_headers
[6] => imap_headerinfo
[7] => imap_rfc822_parse_headers
[8] => imap_rfc822_write_address
[9] => imap_rfc822_parse_adrlist
[10] => imap_body
[11] => imap_bodystruct
[12] => imap_fetchbody
[13] => imap_fetchheader
[14] => imap_fetchstructure
[15] => imap_expunge
[16] => imap_delete
[17] => imap_undelete
[18] => imap_check
[19] => imap_mail_copy
[20] => imap_mail_move
[21] => imap_mail_compose
[22] => imap_createmailbox
[23] => imap_renamemailbox
[24] => imap_deletemailbox
[25] => imap_subscribe
[26] => imap_unsubscribe
[27] => imap_append
[28] => imap_ping
[29] => imap_base64
[30] => imap_qprint
[31] => imap_8bit
[32] => imap_binary
[33] => imap_utf8
[34] => imap_status
[35] => imap_mailboxmsginfo
[36] => imap_setflag_full
[37] => imap_clearflag_full
[38] => imap_sort
[39] => imap_uid
[40] => imap_msgno
[41] => imap_list
[42] => imap_lsub
[43] => imap_fetch_overview
[44] => imap_alerts
[45] => imap_errors
[46] => imap_last_error
[47] => imap_search
[48] => imap_utf7_decode
[49] => imap_utf7_encode
[50] => imap_mime_header_decode
[51] => imap_thread
[52] => imap_timeout
[53] => imap_get_quota
[54] => imap_get_quotaroot
[55] => imap_set_quota
[56] => imap_setacl
[57] => imap_mail
[58] => imap_header
[59] => imap_listmailbox
[60] => imap_getmailboxes
[61] => imap_scanmailbox
[62] => imap_listsubscribed
[63] => imap_getsubscribed
[64] => imap_fetchtext
[65] => imap_scan
[66] => imap_create
[67] => imap_rename
)
mf_2
 
Posts: 20
Joined: 09. February 2004 19:54

Postby Wiedmann » 21. June 2004 20:53

Das ist jezt aber sehr merkwürdig.... PHP gibt ja selbst an, dass diese Funktion existiert.

Und sowas tut wirklich nicht?
Code: Select all
<?php
$mbox = imap_open("{localhost:110}", "admin", "");
?>
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mf_2 » 22. June 2004 15:07

Hallo.

Erstmal danke für die bisherige Hilfe! Nun wird die Funktion erkannt! ( Ein Leerzeichen zwischen imap_open und "(" war das problem )
Aber jetzt bekomme ich folgenden Fehler:

Warning: imap_open(): Couldn't open stream {127.0.0.1/pop3:110}INBOX in C:\xampp\htdocs\mailserver\mailtest2.php on line 2

Ich hab es anfangs mit deinen Werten versucht ( localhost statt 127.0.0.1 und ohne /pop3 ) aber da gabs das gleiche problem.
Hilfe! Ich weiss nicht das ich falsch gemacht habe und habe trotzdem nen Fehler im Script!

Der Mailserver zeigt mir bei einem Verbindungsversuch übrigens folgendes:

Connection from 127.0.0.1, Tue Jun 22 16:00:06 2004
0 sec. elapsed, connection closed Tue Jun 22 16:00:06 2004

Also kommt durchaus ne connection an!

Hier nochmal der quelltext:

<?php
$mbox = imap_open("{127.0.0.1/pop3:110}INBOX", "Admin", "");
?>

Was habe ich falsch gemacht?
mf_2
 
Posts: 20
Joined: 09. February 2004 19:54

Postby Wiedmann » 22. June 2004 15:30

Sorry, das "pop3" zu spezifizieren hab ich vergessen. Da ich hier nur einen IMAP - Server hab, muss ich dieses bei mir nicht angeben...

Du mußt ":110" und "/pop3" vertauschen. Also so:
Code: Select all
<?php
$mbox = imap_open("{localhost:110/pop3}INBOX", "Benutzer", "Passwort");
?>


Benutzer und Passwort stimmen ja wohl mit den Einstellungen an deinem Mailserver überein?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mf_2 » 22. June 2004 19:48

Danke, jetzt funktioniert es!
mf_2
 
Posts: 20
Joined: 09. February 2004 19:54

Previous

Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 45 guests