i got this error

Fatal error: Uncaught exception 'Exception' with message 'Warning: simplexml_load_string(): Entity: line 41: parser error : StartTag: invalid element name in public_html/lib/Varien/Simplexml/Config.php on line 383' in public_html/app/code/core/Mage/Core/functions.php:245 Stack trace: #0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/p...', 383, Array) #1 /public_html/lib/Varien/Simplexml/Config.php(383): simplexml_load_string('loadCache() #3 /public_html/app/code/core/Mage/Core/Model/Config.php(255): Mage_Core_Model_Config->loadModulesCache() #4 /public_html/app/code/core/Mage/Core/Model/App.php(277): Mage_Core_Model_Config->init(Array) #5 /public_html/app/Mage.php(616): Mage_Core_Model_App->init('', 'store', Array) #6 /public_html/sendmail.php(6): Mage: in /public_html/app/code/core/Mage/Core/functions.php on line 245

Using this script

include 'app/Mage.php';


$coll = Mage::getResourceModel('customer/customer_collection');


foreach ($coll as $customer) {
$sendPassToEmail = true;
$customer->sendNewAccountEmail('registered', '',

2 Answers 2


As this isn't real fix of your issue but, as it is still a warning, not real fatal error (this fatal is due to uncaught exception), you can temporary hide xml warnings by using this line right after ini_set


Question: why you don't use shell script extending Mage_Shell_Abstract class? It's easy to implement only one method run().

  • can you give me a example for send bulk email to all users
    – Dhinakar
    Aug 25, 2016 at 10:03

I'm not fan of bulk mailing 15k unique customers using Zend_Mail but here you go:

    /** Returns mail transport object
     * @param $email
     * @param $name
     * @param $templateId
     * @param $emailTemplateVariables
     * @return Mage_Core_Model_Email_Template_Mailer
    protected function getMailObj($email, $name, $templateId, $emailTemplateVariables = array())
        $emailInfo = Mage::getModel('core/email_info');
        $emailInfo->addTo($email, $name);
        /** @var $mailObject Mage_Core_Model_Email_Template_Mailer */
        $mailObject = Mage::getModel('core/email_template_mailer');
                'email' => Mage::getStoreConfig('trans_email/ident_general/email'),
                'name' => Mage::getStoreConfig('trans_email/ident_general/name')

        return $mailObject;

    /** Send new email
     * @return Mage_Core_Model_Email_Template_Mailer
    public function sendEmail($email, $name, $surname, $mailTemplateId)
        $mail = $this->getMailObj(
            $name . ' ' . $surname,
            // these are optional parameters passed to your email template
                'test1' => 'testa',
                'test2' => 'testb'

        return $mail->send();

Where $mailTemplateId is your email template Id created in magento backend. To add another email to queue use: addEmailInfo method before sending.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.