我正在使用Zend_Mail_Transport_Smtp
. 发送部分工作正常,但是,我正在努力尝试将电子邮件复制到发送电子邮件帐户的“已发送”文件夹。从 Zend_Mail 生成消息时,我不断收到Call to a member function getContent() on a non-object.
这是我正在做的事情:
$config = array(
'auth' => 'login',
'username' => $from,
'password' => $password);
$transport = new Zend_Mail_Transport_Smtp('smtp.123-reg.co.uk', $config);
Zend_Mail::setDefaultTransport($transport);
$mail = new Zend_Mail('utf-8');
$mail->addTo('foo@bar.com');
$mail->setSubject('Test');
$mail->setFrom('baz@bar.com', 'Baz');
$mail->setBodyText('This is the email');
$mail->send();
**$message = $mail->generateMessage(); <----- here is the problem**
*This is where I would append the message to the sent folder.*
$mail = new Zend_Mail_Storage_Imap
array('host' => 'imap.123-reg.co.uk',
'user' => 'baz@bar.com',
'password' => 'p'
));
$mail->appendMessage($message,'Sent');
我不确定我是否遗漏了任何东西或完全错误地这样做。任何帮助都会很棒。