Jump to content


send email faild

email

  • Please log in to reply
1 reply to this topic

#1 sonictwb

sonictwb

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 14 May 2015 - 10:30 AM

error log


2015-05-14T16:02:01+08:00 ERR (3): exception 'Zend\Stdlib\Exception\BadMethodCallException' with message 'The option "host" does not have a matching setHost setter method which must be defined' in /opt/perforce/swarm/library/Zend/Stdlib/AbstractOptions.php:96
Stack trace:
#0 /opt/perforce/swarm/library/Zend/Stdlib/AbstractOptions.php(57): Zend\Stdlib\AbstractOptions->__set('host', 'smtp.test.com')
#1 /opt/perforce/swarm/library/Zend/Stdlib/AbstractOptions.php(32): Zend\Stdlib\AbstractOptions->setFromArray(Array)
#2 /opt/perforce/swarm/module/Mail/config/module.config.php(31): Zend\Stdlib\AbstractOptions->__construct(Array)
#3 [internal function]: {closure}(Object(Zend\ServiceManager\ServiceManager), 'mailer', 'mailer')
#4 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(905): call_user_func(Object(Closure), Object(Zend\ServiceManager\ServiceManager), 'mailer', 'mailer')
#5 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(1037): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Object(Closure), 'mailer', 'mailer')
#6 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(609): Zend\ServiceManager\ServiceManager->createFromFactory('mailer', 'mailer')
#7 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(569): Zend\ServiceManager\ServiceManager->doCreate('mailer', 'mailer')
#8 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(503): Zend\ServiceManager\ServiceManager->create(Array)
#9 /opt/perforce/swarm/module/Mail/Module.php(258): Zend\ServiceManager\ServiceManager->get('mailer')
#10 [internal function]: Mail\{closure}(Object(Zend\EventManager\Event))
#11 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(468): call_user_func(Object(Closure), Object(Zend\EventManager\Event))
#12 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('task.commit', Object(Zend\EventManager\Event), NULL)
#13 /opt/perforce/swarm/module/Queue/src/Queue/Controller/IndexController.php(179): Zend\EventManager\EventManager->trigger(Object(Zend\EventManager\Event))
#14 /opt/perforce/swarm/library/Zend/Mvc/Controller/AbstractActionController.php(83): Queue\Controller\IndexController->workerAction()
#15 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /opt/perforce/swarm/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /opt/perforce/swarm/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#20 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#21 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#22 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#23 /opt/perforce/swarm/library/Zend/Mvc/Application.php(309): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#24 /opt/perforce/swarm/public/index.php(57): Zend\Mvc\Application->run()
#25 {main}
Next exception 'Zend\ServiceManager\Exception\ServiceNotCreatedException' with message 'An exception was raised while creating "mailer"; no instance returned' in /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php:912
Stack trace:
#0 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(1037): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Object(Closure), 'mailer', 'mailer')
#1 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(609): Zend\ServiceManager\ServiceManager->createFromFactory('mailer', 'mailer')
#2 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(569): Zend\ServiceManager\ServiceManager->doCreate('mailer', 'mailer')
#3 /opt/perforce/swarm/library/Zend/ServiceManager/ServiceManager.php(503): Zend\ServiceManager\ServiceManager->create(Array)
#4 /opt/perforce/swarm/module/Mail/Module.php(258): Zend\ServiceManager\ServiceManager->get('mailer')
#5 [internal function]: Mail\{closure}(Object(Zend\EventManager\Event))
#6 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(468): call_user_func(Object(Closure), Object(Zend\EventManager\Event))
#7 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('task.commit', Object(Zend\EventManager\Event), NULL)
#8 /opt/perforce/swarm/module/Queue/src/Queue/Controller/IndexController.php(179): Zend\EventManager\EventManager->trigger(Object(Zend\EventManager\Event))
#9 /opt/perforce/swarm/library/Zend/Mvc/Controller/AbstractActionController.php(83): Queue\Controller\IndexController->workerAction()
#10 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#12 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /opt/perforce/swarm/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /opt/perforce/swarm/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /opt/perforce/swarm/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /opt/perforce/swarm/library/Zend/Mvc/Application.php(309): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /opt/perforce/swarm/public/index.php(57): Zend\Mvc\Application->run()
#20 {main}

config.php
<?php
return array(
'environment' => array(
	 'mode' => 'development',
	 'hostname' => 'http://172.16.1.100'
),
'p4' => array(
	 'port' => '172.16.1.216:1666',
	 'user' => 'twb',
	 'password' => '123456',
),
'mail' => array(
	 'transport' => array(
		 'host' => 'smtp.test.com',
		 'port' => 25,
		 'recipients' => array(
			 'test@test.com',
			 ),
		 'connection_class' => 'plain',
		 'connection_config' => array(
			 'username' => 'test@test.com',
			 'password' => '123456',
			 ),

	 ),
),
'log' => array(
	 'priority' => 5,
),
'notifications' => array(
	 'honor_p4_reviews' => true,
),
);

Is there anything wrong?
I used the lasted swarm.ova

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 14 May 2015 - 07:01 PM

Hi Wenbo,

Please compare your config.php setup with the following example here in the article 'Swarm: sending email notification':

http://answers.perfo...rticles/KB/5205

There is more explanation in the User Guide also here under 'Email Configuration':

http://www.perforce....dmin.email.html

One thing that I notice missing from the 'mail' array is the name of the SMTP host, the value that comes before the 'host' value:

 'name' => 'localhost', // name of SMTP host

Please fix and add that value to your config.


You should likely restart your web server after you edit the config file.



Also tagged with one or more of these keywords: email

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users