Zend_Mail won't work

Discussion in 'PHP' started by frostgiant, Jun 16, 2008.

  1. #1
    I am trying to use zend mail to send an e-mail. This is the code that I am using:

    private function _sendEmail($receiver, $email, $subject, $from = '')
    {
    $mail = new Zend_Mail('utf-8');

    if ($from == ''){
    $from = _text('fromAFriend');
    }
    $mail->setFrom($email, $from);
    $mail->addTo($email);
    $mail->setSubject($subject);
    $url = $this->_getSiteUrl();
    $mail->setBodyText("_text('youHaveBeenTipped')". $url . $email);
    try {
    $mail->send();
    } catch (Zend_Mail_Exception $e) {
    echo $e;
    }
    }

    The error I get is: Zend_Mail_Transport_Exception: unable to send mail.

    Any ideas?
     
    frostgiant, Jun 16, 2008 IP