used zend Mail with yii~~~~terrible

I use zend Mail .The error Msg look at the pic.

1794

未命名.jpg

My PHP code is:




require_once 'Zend/Mail/Transport/Smtp.php';

		

            $config = array('auth' => 'login',

            'username' => '270464839',

            'password' => '******');


            $transport = new Zend_Mail_Transport_Smtp('stmp.qq.com', $config);


            $mail = new Zend_Mail();

            $mail->setBodyText('This is the text of the mail.');

            $mail->setFrom('dfgg@t234dfg24est.com', 'Some Sender');

            $mail->addTo('270464839@qq.com', 'Some Recipient');

            $mail->setSubject('TestSubject');

            $mail->send($transport);




And the file is existing!

what’s the problem?

TKS~~~~

IMHO you have to register Zends autoloader

http://blog.mbischof.de/integration-zend-framework-1-10

The problem is that you don’t import the directory where you have Zend.

Import it like this:




Yii::import('application.vendors.*');

require_once 'Zend/Mail/Transport/Smtp.php';



It’s not really necessary to make use of an autoloader - unless you are using a lot of Zend…

TKS~~for you reply.

I think the problem is I have to register Zends autoloader

:lol: