我在Zend的文档中,照着例子子使用Zend_Mail试着发email:如下:require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('[email protected]', 'Some Sender');
$mail->addTo('[email protected]', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send();可是总是出现错误!如下:
Fatal error: Uncaught exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail' in C:\xampp\htdocs\notepad5\library\Zend\Mail\Transport\Sendmail.php:101 Stack trace: #0 C:\xampp\htdocs\notepad5\library\Zend\Mail\Transport\Abstract.php(333): Zend_Mail_Transport_Sendmail->_sendMail() #1 C:\xampp\htdocs\notepad5\library\Zend\Mail.php(648): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail)) #2 C:\xampp\htdocs\notepad5\src\Application\controllers\Indexcontroller.php(230): Zend_Mail->send() #3 C:\xampp\htdocs\notepad5\library\Zend\Controller\Action.php(497): IndexController->testAction() #4 C:\xampp\htdocs\notepad5\library\Zend\Controller\Dispatcher\Standard.php(238): Zend_Controller_Action->dispatch('testAction') #5 C:\xampp\htdocs\notepad5\library\Zend\Controller\Front.php(920): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #6 C:\xampp\htdocs\notepad5\src\index.php(44): Zend_Controller_Front->dispatch() #7 {main} thrown in C:\xampp\htdocs\notepad5\library\Zend\Mail\Transport\Sendmail.php on line 101因为本人刚接触zend不久,所以对其中还是不是很了解,找不到原因,上网也没有搜到。还要请会的人帮帮我!
我想是不是用Zend_mail还需要配制其它的一些什么东东啊?