I have a module which list the email address of the newsletter subscribers in website.I want to save those email id as CSV. but the following code gives a **header already sent error** because i don't know how to disable the theme from the module.

```
header("Content-Type: application/octet-streamn"); 
header("Content-Disposition:attachment;filename=$file");
readfile($tmpdir.$file);

```

any suggestions ?