cancel
Showing results for 
Search instead for 
Did you mean: 

Contact form cant submit

SOLVED

Contact form cant submit

Hi,

 

 

I'm currently have magento 1.9.0.1 and I'm expericing some trouble trying to submit information in a contact form. I'm receiving this error

"Unable to submit your request. Please, try again later"

 

also i tried looking for the root of the problem and i came across this :

 

exception 'Exception' in /home3/officialkeys/public_html/app/code/core/Mage/Contacts/controllers/IndexController.php:107
Stack trace:
#0 /home3/officialkeys/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Contacts_IndexController->postAction()
#1 /home3/officialkeys/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('post')
#2 /home3/officialkeys/public_html/app/code/community/BalkeTechnologies/StoreMaintenance/Controller/Router/Standard.php(91): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#3 /home3/officialkeys/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): BalkeTechnologies_StoreMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /home3/officialkeys/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /home3/officialkeys/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home3/officialkeys/public_html/index.php(87): Mage::run('', 'store')
#7 {main}

 

P-s I'm using a custom theme

8 REPLIES

Re: Contact form cant submit

Hi,

Do you have a 'to' email address setup in:

 

Admin > (from the top) System > Configuration > (from the left) General > Contacts > (main pane) Email Options.

 

If so; add one and it should work again.. if not then can you add app\code\core\Mage\Core\Model\Email\Template.php and around line 508 you should see something like the following:

$this->setSentSuccess($this->send($email, $name, $vars));

Add the following above it:

var_dump($email);
var_dump($name);
var_dump($vars);
exit;

Once you've done that - submit the form again - you should see a white screen with some things output; paste what is output here and then remove the code above again. - This should help us tell you what is wrong.

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Contact form cant submit

Thank you for your reply. Unfortunately the information i got. its really long and the post would not let me exceed 20,000 characters on here . I had to upload the code to textupload you can view the code here  output code.

 

Thank you for any support.

Re: Contact form cant submit

Hi,

Okay - in the same file can you now look at a function that will look as follows:

 

    public function isValidForSend()
    {
        return !Mage::getStoreConfigFlag('system/smtp/disable')
            && $this->getSenderName()
            && $this->getSenderEmail()
            && $this->getTemplateSubject();
    }

Change it too:

    public function isValidForSend()
    {
        var_dump(!Mage::getStoreConfigFlag('system/smtp/disable')
            && $this->getSenderName()
            && $this->getSenderEmail()
            && $this->getTemplateSubject());

        var_dump(Mage::getStoreConfigFlag('system/smtp/disable'));
        var_dump($this->getSenderName());
        var_dump($this->getSenderEmail());
        var_dump($this->getTemplateSubject());
exit;


        return !Mage::getStoreConfigFlag('system/smtp/disable')
            && $this->getSenderName()
            && $this->getSenderEmail()
            && $this->getTemplateSubject();
    }

And once again post the results in here.. as before; once you're done revert the code above back to the original.

 

(the output should not be many lines this time)

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Contact form cant submit

ok so  it looks like it narrow it down to this code 

Re: Contact form cant submit

Hi,

Sorry for my slow response!

 

That code looks fine to be honest - do you have anything in your error logs on your server or can you send mail from other scripts on your server?

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Contact form cant submit

so i tried to run a test and it looks like it might be a server configuration issue. except i dont know where to start with that any ideas?

Re: Contact form cant submit

Hi,

It might be worth consulting your host to ask for their advice.

 

They may have mail disabled on your account; or run a white-list system etc..

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Contact form cant submit

i fixed it.. it was an issue with SMTP. You can install one from the extensions .. SMTP pro