php - Class '\Zend_Mail_Transport_Smtp' not found in Zend -
i trying send email via zend mail transport smtp tried browse sample codes , use it. have code
$config = array('auth' => 'login', 'username' => 'sample@gmail.com', 'password' => 'samplepassword', 'port' => 587, 'ssl' => 'tls');; $transport = new zend_mail_transport_smtp('smtp.gmail.com', $config); $mail = new zend_mail(); $mail->setbodyhtml('hi dave.'); $mail->setfrom('noreply.networklabs@networklabs.com.ph'); $mail->addto('john.decena@nokia.com', 'john.decena@nokia.com'); $mail->setsubject('profile activation'); $mail->send($transport);
apparently, code gives me error
class 'user\controller\zend_mail_transport_smtp' not found
may know i'm missing? because tried study codes didn't have error. , credentials did have use.? in advance.
this looks namespace problem.
i don't know version of zf2 using, need add use
statement @ beginning of file, like
use zend\mail\transport\smtp;
and create new instance with
$transport = new smtp('smtp.gmail.com', $config);
Comments
Post a Comment