Re: pursing a text file

From: Date: Thu, 09 Aug 2001 08:26:23 +0000
Subject: Re: pursing a text file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62053@lists.php.net to get a copy of this message
> $message = $buffer; > echo $message; <it will work if I add this echo but this is You want: $message .= $buffer; This *APPENDS* $buffer to $message. Before you were wiping out each line after you got it. Your echo will now show 1 line, then 2 lines, then 3 lines, etc as the message "builds", but the mail() will work. And you need "\r\n" for any place you want a newline. So, probably: $message .= "$buffer\r\n"; is your final code. Actually, you could optimize it a bit by use fread($fp, filesize($path)) and suck the whole file in as one big chunk of text. Only matters if he's sending lots of email though, and that will choke the mail() function anyway. See Manuel Lemos' UpperDesign.com mail class for how to spew mass quantities of email out. Oh yeah: It's called "pArsing" with an "A". I think I like pursing better, though :-) -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#62053) next »