Email entire output

Discussion in 'PHP' started by champ_rock, May 3, 2007.

  1. #1
    hi

    i have got a simple script which has a single array and a foreach command and it produces precesses that array and produces an output

    now i want to email all the output produced to my email..

    the problem is that i cannot set the $message to take data from that output

    any suggestions for that?
     
    champ_rock, May 3, 2007 IP
  2. sky22

    sky22 Guest

    Messages:
    59
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    To get the output put the following at the start of the code:

    ob_start();
    PHP:
    and then at the bottom put:

    $all_output = ob_get_contents(); // gets the output
    ob_end_clean();
    
    mail ( 'you@youdomain.tld', 'Output', $all_output );//sends the output
    
    PHP:
    Sky22
     
    sky22, May 3, 2007 IP
    champ_rock likes this.