修复不能发邮件的错误

This commit is contained in:
wlx 2013-06-21 09:05:21 +00:00
parent 2b369ef8c2
commit 2c474145f5
1 changed files with 5 additions and 4 deletions

View File

@ -240,13 +240,14 @@ class ReviewListener implements Zend_EventManager_ListenerAggregate
//email message //email message
if(isset($emails) &&is_array($emails) && count($emails)>0) if(isset($emails) &&is_array($emails) && count($emails)>0)
{ {
$mail=new WestdcMailer($this->view->config->smtp); $config=Zend_Registry::get('config');
$mail=new WestdcMailer($config->smtp);
$sql="select m.uuid,m.title from metadata m left join mdstatus s on m.uuid=s.uuid where s.id='$id'"; $sql="select m.uuid,m.title from metadata m left join mdstatus s on m.uuid=s.uuid where s.id='$id'";
$rs=$this->db->query($sql); $rs=$this->db->query($sql);
$res=$rs->fetch(); $res=$rs->fetch();
$mailtp=new EmailText($this->db,'metadata-publish',array('uuid'=>$res['uuid'],'title'=>$res['title'])); $mailtp=new EmailText($this->db,'metadata-publish',array('uuid'=>$res['uuid'],'title'=>$res['title']));
$mail->setBodyText($mailtp->getBody()); $mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->setFrom($config->service->email,'西部数据中心服务组');
foreach($emails as $email) $mail->addTo($email); foreach($emails as $email) $mail->addTo($email);
$mail->setSubject($mailtp->getSubject()); $mail->setSubject($mailtp->getSubject());
$mail->send(); $mail->send();