Jump to content

Makes an instant email text file to download.


Recommended Posts

Name: email_dump.zip

Version: 1.0

Author: Alistair Brookbanks (Brooky)

Short Description: Makes an instant email text file dump to download.

Long Description:

On clicking a text link a dialog box is made giving the administrator the option to download a text file dump of all email addresses who have specifically siad they wish to recieve store emails. Very useful for bulk email software.

[Download File]

Link to comment
Share on other sites

Why?

This is useful for bulk email software if you have a large client base. The built in email form is likely to time out if you have 400+ emails to send at one time. This of course depends upon server setup. B)

Use it with software such as Mail List King (http://www.xequte.com) or similar.

Enjoy (Its about time I made a mod eigh :()

p.s. This will be integrated in the next version of cubecart.

Link to comment
Share on other sites

Hi Brooky, me ole son :(

I've uploaded your e-mail dump mod and when I run it I get this:

Warning: Cannot add header information - headers already sent by (output started at /www/public_html/admin/lang/English.inc.php:1185) in /www/public_html/admin/email.php on line 42

This line is repeated about 10 times... any clues?

Link to comment
Share on other sites

It's 2am and I have now spent 4 hours hacking the following piece of code around - nothing I do wants to make it work B)

session_start();

if (!session_is_registered("admin"))

  {

    header("Location: login.php");

  }

if(session_is_registered("admin")){

include ("config.php");

include( "settings.inc.php");

if($dump){

$sql_email = "select distinct email from ".$prefix."store_customer where email <> '' and perm ='Y'";

     $result = mysql_query ($sql_email);



     while ($row = mysql_fetch_array($result))

     {

 	 $email = $row["email"];

header("Content-type: text/plain");

header("Content-Disposition: attachment; filename=email_dump.txt");

readfile('email_dump.txt');



 	 echo $row_rsEmail['user'];

 	 echo "\n";



     }

exit;

}




When I run email.php I simply get this:




Warning: Cannot add header information - headers already sent by (output started at /www/public_html/admin/lang/English.inc.php:1193) in /www/public_html/admin/email.php on line 43



Warning: Cannot add header information - headers already sent by (output started at /www/public_html/admin/lang/English.inc.php:1193) in /www/public_html/admin/email.php on line 44



Warning: Cannot add header information - headers already sent by (output started at /www/public_html/admin/lang/English.inc.php:1193) in /www/public_html/admin/email.php on line 43



Warning: Cannot add header information - headers already sent by (output started at /www/public_html/admin/lang/English.inc.php:1193) in /www/public_html/admin/email.php on line 44




There was only one time I actually got a download dialog come up and that was when I inserted:




ob_start("ob_gzhandler");




right at the top after <?php, but this turned out to be a false lead because the file it downloaded was blank.



The following piece of test code worked perfectly:




<?

    //set the document type

    header("Content-Type: application/vnd.ms-excel");

    header("Content-Disposition: filename=\"tricks.xls\"");



    //send some tab-delimited data

    print("Tricks of the Trade\r\n");



    for($i=1; $i < 100; $i++)

    {

        for($j=1; $j <= 10; $j++)

        {

            print(pow($i, $j) . "\t");

        }

        print("\r\n");

    }

?>

maybe that will give somebody a clue... I dunno, this thing's wasted me. I really need this mod to work - surely I cannot be the only person to have downloaded it??? :(

PHP Version: 4.2.1

MySQL Version 3.23.49a-Max-log

Link to comment
Share on other sites

×
×
  • Create New...