I have been working on a custom extension and I need a function to send the generated CSV file. Can you please let me know what might be the possible error in it.

protected function _sendCSV($filename, $subject, $last_update, $now) {
    $template_id = "svm_export_email";
    $email_template =  Mage::getModel('core/email_template')-&gt;loadDefault($template_id)-&gt;setSubject($subject." [".$now."]");
    $template_variables = array(
        'file_name' =&gt; $filename,
        'last_update' =&gt; $last_update,
        'now' =&gt;$now,
        );
    $email_template-&gt;getProcessedTemplate($template_variables);

    $sender = array('My Team' =&gt; Mage::getStoreConfig('trans_email/ident_general/email'));
    $email_template-&gt;setFrom($sender);


    $file = Mage::getBaseDir('var') . DS .'SVM'. DS .date('Y'). DS .date('m'). DS .$filename;
    $attachment = $email_template-&gt;getMail()-&gt;createAttachment(file_get_contents($file));
    $attachment-&gt;filename = $filename;

    try {
        $email_template-&gt;send('thecoderin@gmail.com','My Gmail');
    } catch (Exception $e) {
        Mage::log($e-&gt;getMessage(), NULL, self::LOG);
        return false;
    }
    Mage::log($filename." File sent through mail", NULL, self::LOG);
    return true;
}


I am getting the following error on invoking the function:

exception 'Exception' with message 'This letter cannot be sent.' in /my/magento/root/app/code/core/Mage/Core/Model/Email/Template.php:398


Thanks!


Question: XNA 2D camera just part of screen
Answer: Sure! Since there's no concept of 2D camera built into XNA, I am guessing that you are using some class to generate a ViewMatrix and passing that matrix as a parameter to SpriteBatch.Begin().

If that's the case, the solution is simple... All you have to do is draw your score and anything that you don't want to be affected by the camera in a separate SpriteBatch.Begin() / SpriteBatch.End() block, but without passing it the ViewMatrix. Example:

spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, camera.ViewMatrix);
// Draw game world
spriteBatch.End();

spriteBatch.Begin();
// Draw score and other information
spriteBatch.End();