简体   繁体   中英

Transactional emails stop working - Magento

I am new here. My site was working perfectly for the last year, this week I made two changes: 1.- Create a new shop view 2.- Renew my hosting After that all magento emails stop sending. Email accounts are well defined Templates are in the right folder

I installed AOE Scheduler and everything seems to be fine: AOE Scheduler If I check the table "core_email_queue" in the DB the entries are properly created And after five minutes are "processed" After cron execution

I have also tried to send an email directly with following code:

    <?php 
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "x@gmail.com";
    $to = "x@gmail.com";
    $subject = "PHP Mail Test script";
    $message = "This is a test to check the PHP Mail functionality";
    $headers = "From:" . $from;
    mail($to,$subject,$message, $headers);
    echo "Test email sent";
?>

and it works. I don't know what else to try. Thank you in advance for any help.

exception.log

2017-02-05T09:59:14+00:00 DEBUG (7): Exception message: This email address is already assigned to another user.
Trace: #0 /home/oo1lu856/public_html/app/code/core/Mage/Newsletter/controllers/SubscriberController.php(61): Mage::throwException('This email addr...')
#1 /home/oo1lu856/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Newsletter_SubscriberController->newAction()
#2 /home/oo1lu856/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('new')
#3 /home/oo1lu856/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /home/oo1lu856/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#5 /home/oo1lu856/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home/oo1lu856/public_html/index.php(83): Mage::run('', 'store')
#7 {main}
2017-02-05T09:59:29+00:00 DEBUG (7): Exception message: This email address is already assigned to another user.
Trace: #0 /home/oo1lu856/public_html/app/code/core/Mage/Newsletter/controllers/SubscriberController.php(61): Mage::throwException('This email addr...')
#1 /home/oo1lu856/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Newsletter_SubscriberController->newAction()
#2 /home/oo1lu856/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('new')
#3 /home/oo1lu856/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /home/oo1lu856/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#5 /home/oo1lu856/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home/oo1lu856/public_html/index.php(83): Mage::run('', 'store')
#7 {main}

system.log

2017-01-31T21:59:49+00:00 ERR (3): Warning: simplexml_load_string(): (null)Entity: line 2: parser error : out of memory error  in /home/oo1lu856/public_html/lib/Varien/Simplexml/Config.php on line 383
2017-01-31T21:59:49+00:00 ERR (3): Warning: simplexml_load_string(): tem&gt;*&lt;/to_order_item&gt;&lt;/weee_tax_applied&gt;&lt;weee_tax_applied_amount&gt;&lt;to_order_item&gt;  in /home/oo1lu856/public_html/lib/Varien/Simplexml/Config.php on line 383
2017-01-31T21:59:49+00:00 ERR (3): Warning: simplexml_load_string():                                                                                ^  in /home/oo1lu856/public_html/lib/Varien/Simplexml/Config.php on line 383
2017-01-31T21:59:49+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 2: parser error : xmlSAX2Characters  in /home/oo1lu856/public_html/lib/Varien/Simplexml/Config.php on line 383
2017-01-31T21:59:49+00:00 ERR (3): Warning: simplexml_load_string(): tem&gt;*&lt;/to_order_item&gt;&lt;/weee_tax_applied&gt;&lt;weee_tax_applied_amount&gt;&lt;to_order_item&gt;  in /home/oo1lu856/public_html/lib/Varien/Simplexml/Config.php on line 383
2017-01-31T21:59:49+00:00 ERR (3): Warning: simplexml_load_string():

Solved by avoiding cron. It seems that when a renew the hosting the server has been changed and doesn't allow to run cron.sh The hosting provider only offered to change to a dedicate server, due to the low volumes of my magento shop makes no sense. So I avoid queueing the order emails by editing:

/app/code/core/Mage/Core/Model/Email/Template.php Line:407(approximate) 

/*if (!($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue)) {
    ## @var $emailQueue Mage_Core_Model_Email_Queue 
    $emailQueue = $this->getQueue();
    $emailQueue->setMessageBody($text);
    $emailQueue->setMessageParameters(array(
    'subject'           => $subject,
    'return_path_email' => $returnPathEmail,
    'is_plain'          => $this->isPlain(),
    'from_email'        => $this->getSenderEmail(),
    'from_name'         => $this->getSenderName(),
    'reply_to'          => $this->getMail()->getReplyTo(),
    'return_to'         => $this->getMail()->getReturnPath(),
    ))
    ->addRecipients($emails, $names, Mage_Core_Model_Email_Queue::EMAIL_TYPE_TO)
    ->addRecipients($this->_bccEmails, array(), Mage_Core_Model_Email_Queue::EMAIL_TYPE_BCC);
    $emailQueue->addMessageToQueue();

    return true;
}*/

Don't edit the core files, create a new folder in the following path

/app/code/local/Mage/Core/Model/Email

and copy the edited template.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM