Autor Zpráva
paulos e.
Profil *
Nevíte jak udělat aby když se pošle mail na určitou adresu aby mi to přišlo do určitýho stránky?
llook
Profil
Ta stránka může sama přes POP3 nebo IMAP stahovat a zobrazovat poštu. Podívej se v manuálu na imap funkce: http://www.php.net/manual/en/ref.imap.php
To je asi tak nejschůdnější cesta.
paulos e.
Profil *
Dík snad to přeluštim.
paulos e.
Profil *
Sakra. Sem asi blbější než sem myslel. Ten kód sem si zkopíroval,ale stejně to píše asi 5 chyb.
paulos e.
Profil *
znáte ještě nějaký stránky kde je něco o IMAP? Dík
Hugo
Profil
paulos e.

google?
error414-
Profil *
Nepise to neco ve smyslu ze nemas nainstalovane najake knihovny, teda pokud to zpostis na localhostu.
Aspon bys mohl napsat vypis tech erroru, nebo zdrojovy kod.
paulos e.
Profil *
<HTML> 

<HEAD>
<TITLE>imap_check</TITLE>
</HEAD>
<BODY>
<?


//check for new messages




$mailbox = imap_open("{localhost/pop3:110}INBOX",
"#username#","#password#");

// Check messages
$check = imap_check($mailbox);
print("<PRE>");
print("Date most recent message : " . $check->Date);
print("<BR>");
print("Connection type : " . $check->Driver);
print("<BR>");
print("Name of the mailbox : " . $check->Mailbox);
print("<BR>");
print("Number of messages : " . $check->Nmsgs);
print("<BR>");
print("Number of recent messages : " . $check->Recent);
print("<BR>");
print("</PRE>");

// show headers for messages

$index=1;

$header = imap_header($mailbox, $index);
print("<PRE>");
print("Header Date : " . $header->Date . "<BR>");
print("Header To : " . $header->to) . "<BR>";
print("Header From : " . $header->From . "<BR>");
print("Header cc : " . $header->cc . "<BR>");
print("Header ReplyTo : " . $header->ReplyTo . "<BR>");
print("Header Subject : " . $header->Subject . "<BR></PRE>");

print("<PRE>");
print(imap_body($mailbox,$index));
print("</PRE><HR>");

imap_close($mailbox);
?>

Vim na sto procent že mi tam něco chybí.
paulos e.
Profil *
Máte někdo skušenosti s IMAP? Mohli by ste poradit? Dík
paulos e.
Profil *
To fakt nikdo nezná odpověď? Ani admini? No neva.
paulos e.
Profil *
Tak sem konečně našel ten kód,ale píše mi to Fatal error: Class auth_container_imap: Cannot inherit from undefined class auth_container in /3w/wz.cz/p/paulosetruska/mail/Auth/Container.php on line 51 nevíte proč?

<?php

//
// +--------------------------------------------------------------------- -+
// | PHP Version 4 |
// +--------------------------------------------------------------------- -+
// | Copyright (c) 1997-2003 The PHP Group |
// +--------------------------------------------------------------------- -+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +--------------------------------------------------------------------- -+
// | Authors: Jeroen Houben <jeroen@terena.nl> |
// +--------------------------------------------------------------------- -+
//
// $Id: IMAP.php,v 1.1 2003/09/16 19:18:08 cyface Exp $
//

require_once "Auth/Container.php";
require_once "PEAR.php";

/*
* Storage driver for fetching login data from an IMAP server
*
* This class is based on LDAP containers, but it very simple.
* By default it connects to localhost:143
* The constructor will first check if the host:port combination is
* actually reachable.
* It then tries to create an IMAP stream (without opening a mailbox)
* To use this storage containers, you have to use the
* following syntax:
*
* <?php
* ...
* $params = array(
* 'host' => 'mail.example.com',
* 'port' => 143,
* );
* $myAuth = new Auth('IMAP', $params);
* ....
*
/**
*
* @author Jeroen Houben <jeroen@terena.nl>
* @package Auth
* @version $Revision: 1.1 $
*/
class Auth_Container_IMAP extends Auth_Container
{
/**
* Options for the class
* @var array
*/
var $options = array();

/**
* Constructor of the container class
*
* @param $params, associative hash with host,port,basedn and userattr key
* @return object Returns an error object if something went wrong
*/
function Auth_Container_IMAP($params)
{
if (!extension_loaded('imap')) {
return PEAR::raiseError("Cannot use IMAP authentication, IMAP extension not loaded!",
41, PEAR_ERROR_DIE);
}
$this->_setDefaults();

// set parameters (if any)
if (is_array($params)) {
$this->_parseOptions($params);
}

$this->_checkServer();
return true;
}

/**
* Set some default options
*
* @access private
*/
function _setDefaults()
{
$this->options['host'] = 'localhost';
$this->options['port'] = 143;
}


/**
* Check if the given server and port are reachable
*
* @access private
*/
function _checkServer($timeout=20) {
$fp = @fsockopen ($this->options['host'], $this->options['port'],
$errno, $errstr, $timeout);
if ($fp) {
@fclose($fp);
} else {
$message = "Error connecting to IMAP server "
. $this->options['host']
. ":" . $this->options['port'];
return PEAR::raiseError($message, 41, PEAR_ERROR_DIE);
}
}

/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
$this->options[$key] = $value;
}
}

/**
* Try to open a IMAP stream using $username / $password
*
* @param string Username
* @param string Password
* @return boolean
*/
function fetchData($username, $password)
{
$conn = @imap_open ('{'.$this->options['host'].':'.$this->options['port'].'}', $username, $password, OP_HALFOPEN);
if ($conn) {
$this->activeUser = $username;
@imap_close($conn);
return true;
} else {
$this->activeUser = '';
return false;
}
}
}
?>

Toto téma je uzamčeno. Odpověď nelze zaslat.

0