How to attach email from a private folder(outside root) I'm trying to attach a file to an email. It's part of job application so a person goes to a node, presses apply and it sends an email to the creator of the node. I want to attach a CV &amp; cover letter to it.

The problem is I'm storing the CV &amp; cover letter in a private folder outside of drupal root. (Personal info security and all that.) The code below works for public folders. How would I got about altering it to access private ones?

function tellafriend_mail($key, &amp;$message, $params) {

        global $base_url;

        $message['subject'] = t('Your friend thought you might like this site');

        $message['body'][] = t("Hello,\nYour friend thought you might like this site.  Please click the link below to visit.\n\n!link", array('!link' =&gt; $base_url));
        $attachment = array(
          'filecontent' =&gt; file_get_contents('http://localhost/private/counciltax.txt'),    
          'filename' =&gt; 'test.txt',
          'filemime' =&gt; 'textplain',
        );
        $message['params']['attachments'][] = $attachment;
   }
You can use the drupal private file directory notation:

file_get_contents('private://counciltax.txt')