Tôi chạy vào vấn đề này khi Magento đã không được gửi đi quên email mật khẩu (chưa báo cáo nó đã làm cho người sử dụng) sau đó sau khi nhìn vào /var/log/exception.log
tìm thấy lỗi nó được tạo ra là:
2012-05-30T04:27:54+00:00 ERR (3):
exception 'Exception' with message 'This letter cannot be sent.' in /home/magento/www/app/code/core/Mage/Core/Model/Email/Template.php:354
Stack trace:
#0 /home/magento/www/app/code/core/Mage/Core/Model/Email/Template.php(463): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#1 /home/magento/www/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(79): Mage_Core_Model_Email_Template->sendTransactional('customer_passwo...', 'support', Array, Array, Array, '1')
#2 /home/magento/www/app/code/core/Mage/Customer/Model/Customer.php(646): Mage_Core_Model_Email_Template_Mailer->send()
#3 /home/magento/www/app/code/core/Mage/Customer/Model/Customer.php(663): Mage_Customer_Model_Customer->_sendEmailTemplate('customer/passwo...', 'customer/passwo...', Array, '1')
#4 /home/magento/www/app/code/core/Mage/Customer/controllers/AccountController.php(554): Mage_Customer_Model_Customer->sendPasswordResetConfirmationEmail()
#5 /home/magento/www/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Customer_AccountController->forgotPasswordPostAction()
#6 /home/magento/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('forgotpasswordp...')
#7 /home/magento/www/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /home/magento/www/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#9 /home/magento/www/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#10 /home/magento/www/index.php(84): Mage::run('default', 'store')
#11 {main}
Vì vậy, mở ra /app/code/core/Mage/Core/Model/Email/Template.php
và tìm thấy đoạn code đó được ném lỗi này (on line 354) là:
if (!$this->isValidForSend()) {
Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
return false;
}
Vì vậy, đã có một cái nhìn tại isValidForSend()
:
public function isValidForSend()
{
return !Mage::getStoreConfigFlag('system/smtp/disable')
&& $this->getSenderName()
&& $this->getSenderEmail()
&& $this->getTemplateSubject();
}
gia tăng một số khai thác gỗ của các biến vào lúc bắt đầu của hàm là một trong những phải được trở về false
:
Mage::Log(var_export(!Mage::getStoreConfigFlag('system/smtp/disable'),true).';'.var_export($this->getSenderName(),true).';'.var_export($this->getSenderEmail(),true).';'.var_export($this->getTemplateSubject(),true),null,'email.log');
nào tạo ra các tập tin đăng nhập /var/log/email.log
trong đó có:
2012-05-30T04:44:37+00:00 DEBUG (7): false;'CustomerSupport';'[email protected]';'Password Reset Confirmation for {{var customer.name}}'
Vì vậy, vấn đề là: !Mage::getStoreConfigFlag('system/smtp/disable')
mà bạn có thể sửa chữa trong Admin > System > Configuration > Advanced > System > Mail Sending Settings
và thay đổi Disable Email Communications
thành No
để các email là NOT bị vô hiệu hóa.
Bây giờ nó hoạt động :)
Tôi đã thêm mô-đun smtp cho Magento hỗ trợ xác thực nhưng vẫn đang cố gửi thư đúng phương thức sendmail/sendmail.php: S rất bực bội, tập lệnh php thông thường hoạt động tốt với thư Magento sẽ không gửi bất kỳ email giao dịch nào hoặc Mâu liên hệ. – Ilse
Roundcube gửi thư điện tử ra sao, làm cách nào tôi có thể làm cho Magento cũng gửi thư? Bất cứ đề nghị về thix? Cám ơn! – Ilse