【发布时间】:2017-01-14 18:19:12
【问题描述】:
我在控制器中的代码: `
public function filetransport()
{
set_time_limit(0);
$message = new Zend_Mail_Message();
$message->addTo('matthew@zend.com')
->addFrom('ralph.schindler@zend.com')
->setSubject('Greetings and Salutations!')
->setBody("Sorry, I'm going to be late today!");
// Setup File transport
$transport = new Zend_Mail_Transport_File();
$transport->setOptions(array(
'path' => 'data/mail/',
'callback' => function (Zend_Mail_Transport_File $transport) {
return 'Message_' . microtime(true) . '_' . mt_rand() . '.txt';
},
));
$transport->send($message);
}
在创建 Zend_Mail_Message 实例时,它抛出错误。错误是
Catchable fatal error: Argument 1 passed to Zend_Mail_Message::__construct()
must be of the type array, none given,
called in C:\xampp\htdocs\Zend-Mailer\application\controllers\IndexController.php on line 102
and defined in C:\xampp\htdocs\Zend-Mailer\library\Zend\Mail\Message.php on line 57
如果您对此有任何想法,请告诉我.....!
【问题讨论】:
标签: php zend-framework zend-mail