请执行以下操作以获取有关错误的更多信息:
[...]
try {
$mail->send($transport);
}
catch(Zend_Exception $e) {
die($e->getMessage());
}
[...]
请张贴在这里...
有很多问题会产生 500 服务器错误!
对不起,我刚刚看到你的错误!
这是错误的语法!
$transport = new Zend_Mail_Transport_Sendmail();
Zend_Loader::loadClass('Zend_Mail');
$mail = new Zend_Mail();
$mail->setFrom('someone@gmail.com', 'Name');
$mail->addTo('someother@gmail.com','Aaaaaa');
$mail->setSubject('Testing ');
$mail->setBodyText('Welcome');
$mail->send($transport);
这是对的!
$transport = new Zend_Mail_Transport_Sendmail('no-reply@mydomain.com');
//you need to set the transport adapter via abstract method!
Zend_Mail::setDefaultTransport($transport);
$mail = new Zend_Mail();
$mail->setFrom('someone@gmail.com', 'Name');
$mail->addTo('someother@gmail.com','Aaaaaa');
$mail->setSubject('Testing ');
$mail->setBodyText('Welcome');
$mail->send(); //no parameters here!
更多信息...
http://framework.zend.com/manual/1.12/en/zend.mail.introduction.html