My code in controller: `
public function filetransport()
{
set_time_limit(0);
$message = new Zend_Mail_Message();
$message->addTo('[email protected]')
->addFrom('[email protected]')
->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);
}
While creating instance of Zend_Mail_Message it is throwing error.The Error is
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
If you have idea about this please let me know.....!
According to Zend documentation
Zend_Mail_Messageaccepts one argument as the parameter. You are not passing any parameter. That is why you get this error.From Zend_Mail_Part docs,
That means, as the error is saying, you are missing the
paramsarray in the constructor.