开发者

Using Zend Mail Pop3 as a module

开发者 https://www.devze.com 2023-03-21 02:54 出处:网络
I would like to use the Mail module of Zend Framework. I have extracted all the Zend lib in my project lib folder.

I would like to use the Mail module of Zend Framework. I have extracted all the Zend lib in my project lib folder.

So how can I load the Mail module for using this module: http://framework.zend.com/manual/1.0/en/zend.mail.read.html?

I have tried this:

include("lib/Zend/Loader.php");
Zend_Loader::loadClass('Mail');

$mail = new Zend_Mail_Storage_Pop3(array('host'     => 'xxxxx',
                                         'user'     => 'xxxxx',
                                         'password' => 'xxxxx'));

My project structure is this:

-project-&g开发者_运维问答t;lib->Zend->All the Zend lib files

-projects/index.php

For example:

 Warning: require_once(Zend/Mail/Transport/Abstract.php) [function.require-once]: failed to open stream: No such file or directory 

Do I really have to modify all the require_once manually?

But I have returned errors about include path in others module files.

Thanks a lot.


Try:

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

See the autoloader reference:

  • http://framework.zend.com/manual/en/learning.autoloading.usage.html

and php's __autoload function if you want to write custom autoloader.

You may also add the paths with the libraries to the include_path (see set_include_path/get_include_path)

e.g.

set_include_path(implode(PATH_SEPARATOR, array(
    'path/to/zend/lib/',
    get_include_path(),
)));
0

精彩评论

暂无评论...
验证码 换一张
取 消