Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8618635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:09:19+00:00 2026-06-12T06:09:19+00:00

I’ve been looking for guides on how to read and understand a stack trace.

  • 0

I’ve been looking for guides on how to read and understand a stack trace.
In this case, people are getting errors when trying to fill out and send an contact form. And I’am really having trouble fixing this, and it’s not any easier when I cannot decipher the stack. (This is a magento 1.6.2 installation)

The email are being sent, but the contact form tells the user that there was a problem, so we get alot of duplicates from people trying again, and again.

exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. mail(/var/www/site.dk/logs/php-maillog.log): failed to open stream: Permission denied' in /var/www/site.dk/public_html/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace: 
#0 /var/www/site.dk/public_html/lib/Zend/Mail/Transport/Abstract.php(348):      Zend_Mail_Transport_Sendmail->_sendMail()
#1 /var/www/site.dk/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /var/www/site.dk/public_html/app/code/core/Mage/Core/Model/Email/Template.php(409): Zend_Mail->send()
#3 /var/www/site.dk/public_html/app/code/core/Mage/Core/Model/Email/Template.php(462): Mage_Core_Model_Email_Template->send('email@email.com', NULL, Array)
#4 /var/www/site.dk/public_html/app/code/core/Mage/Contacts/controllers/IndexController.php(104): Mage_Core_Model_Email_Template->sendTransactional('1', 'general', 'email@email.com', NULL, Array)
#5 /var/www/site.dk/public_html/app/code/local/Mage/Core/Controller/Varien/Action.php(420): Mage_Contacts_IndexController->postAction()
#6 /var/www/site.dk/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('post')
#7 /var/www/site.dk/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /var/www/site.dk/public_html/app/code/local/Mage/Core/Model/App.php(348): Mage_Core_Controller_Varien_Front->dispatch()
#9 /var/www/site.dk/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#10 /var/www/site.dk/public_html/shop/index.php(80): Mage::run('store...', 'store')
#11 {main}

The snippet from sendmail.php

public function _sendMail()
{
    if ($this->parameters === null) {
        set_error_handler(array($this, '_handleMailErrors'));
        $result = mail(
            $this->recipients,
            $this->_mail->getSubject(),
            $this->body,
            $this->header);
        restore_error_handler();
    } else {
        if(!is_string($this->parameters)) {
            /**
             * @see Zend_Mail_Transport_Exception
             * 
             * Exception is thrown here because
             * $parameters is a public property
             */
            #require_once 'Zend/Mail/Transport/Exception.php';
            throw new Zend_Mail_Transport_Exception(
                'Parameters were set but are not a string'
            );
        }

        set_error_handler(array($this, '_handleMailErrors'));
        $result = mail(
            $this->recipients,
            $this->_mail->getSubject(),
            $this->body,
            $this->header,
            $this->parameters);
        restore_error_handler();
    }

    if ($this->_errstr !== null || !$result) {
        /**
         * @see Zend_Mail_Transport_Exception
         */
        #require_once 'Zend/Mail/Transport/Exception.php';
       (137) throw new Zend_Mail_Transport_Exception('Unable to send mail. ' . $this->_errstr);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:09:20+00:00Added an answer on June 12, 2026 at 6:09 am

    I was going to write this as a comment, but it’s going to be too long for the comment box.

    If we go through the stack trace line by line you will start to understand what’s going on:

    exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. mail(/var/www/site.dk/logs/php-maillog.log): failed to open stream: Permission denied' in /var/www/site.dk/public_html/lib/Zend/Mail/Transport/Sendmail.php:137
    

    Firstly, the exception type, it’s Zend_Mail_Transport_Exception which will give us an idea on where to start looking. In this case it’s an error occurring somewhere in the Zend_Mail code.

    Secondly, the message 'Unable to send mail. mail(/var/www/site.dk/logs/php-maillog.log): failed to open stream: Permission denied'. To me, this seems pretty clear, we are getting a permission denied error when the php-maillog.log is trying to be opened. What’s causing this? That’s what you will have to determine.

    Thirdly, we are shown where the exception is actually occurring /var/www/site.dk/public_html/lib/Zend/Mail/Transport/Sendmail.php:137. So it’s occurring on line 137 of the Sendmail.php as you have noted.

    The rest of the stack trace is the path that PHP took to get to the error. That is, which function called what to get to the point where you are seeing the exception. This is reported from the last thing to be added onto the stack, back to the first, so you are pretty much tracing your code backwards through the function calls.

    In this case, you can see that the code on line 348 of /var/www/site.dk/public_html/lib/Zend/Mail/Transport/Abstract.php called the _sendMail function which exceptioned…the line 348 code was called by the code on line 1194 in /var/www/site.dk/public_html/lib/Zend/Mail.php and so on.

    TL:DR?

    Magento is having an issue opening the /var/www/site.dk/logs/php-maillog.log file. Are the permissions set correctly for this file? Does the /var/www/site.dk/logs/ directory exist?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.