Php 为什么我在使用Zend Framework 1发送电子邮件时收到500个内部服务器错误?

Php 为什么我在使用Zend Framework 1发送电子邮件时收到500个内部服务器错误?,php,linux,email,zend-framework,linux-distro,Php,Linux,Email,Zend Framework,Linux Distro,我在使用Zend Framework 1和下面提到的代码发送电子邮件时遇到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','Aaa

我在使用Zend Framework 1和下面提到的代码发送电子邮件时遇到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);
我在执行联机发送方法时出错


因此,请帮助我。

请执行以下操作以获取有关错误的更多信息:

[...]

try {
    $mail->send($transport);
}
catch(Zend_Exception $e) {
    die($e->getMessage());
}

[...]
请把它贴在这里

有许多问题会导致500服务器错误

对不起,我刚刚看到了你的错误

这是错误的语法

这是正确的

更多信息。。。

请查看您的错误日志,这样您就不必猜测发生了什么。您是否使用wamp或xampp在计算机上进行本地开发?如果是这样的话,在没有配置某些模块之前,您无法发送邮件。@DanFromGermany在错误日志中,我看到了HTTP:500error@Holt,我不是在本地使用xampp,而是在live server上使用。@goggler这是访问日志,我们需要错误日志
$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!