nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

Probleme mit imap funktionen

Von: Julian Schlotterbeck (julian.schlotterbeck@googlemail.com) [Profil]
Datum: 05.11.2009 15:57
Message-ID: <ca105e70-c3f2-47d5-9840-828703200f2b@r24g2000yqd.googlegroups.com>
Newsgroup: de.comp.lang.php.netzprotokolle
Hier mein Code:

class MailServer {
protected $connection;

function __construct() {
$this->connect();
}

function connect() {
$host = '{217.114.75.67:143/notls}INBOX';
$connection = @imap_open($host, 'ich', 'geheim') or die(imap_errors
());

$this->getHeader();
$this->closeConnection();
}

function getHeader() {
echo "<p><h1>Mailboxes</h1>\n";
$folders = imap_listmailbox ($connection, $host, "*");

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

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

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

}

function closeConnection() {
imap_close($connection);
}
}




Und hier die Ausgabe:

Mailboxes

Warning: imap_listmailbox(): supplied argument is not a valid imap
resource in /var/www/newsletterAuslesen/MailServer.class.php on line
26
Call failed

Headers in INBOX

Warning: imap_headers(): supplied argument is not a valid imap
resource in /var/www/newsletterAuslesen/MailServer.class.php on line
37
Call failed

Warning: imap_close(): supplied argument is not a valid imap resource
in /var/www/newsletterAuslesen/MailServer.class.php on line 50

[ Auf dieses Posting antworten ]

Antworten