Re: Truncating Lines
| From: | brett | Date: | Thu, 25 Oct 2001 23:58:26 +0000 |
| Subject: | Re: Truncating Lines | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72371@lists.php.net to get a copy of this message | ||
> > I have the following code, which reads in an html file
> >
> > $fd = fopen("somefile.html", "r");
> > while (!feof($fd)) {
> > $buffer = fgets($fd, 4096);
> > $body .= $buffer;
> > }
> > fclose($fd);
> >
> > I am then mailing this:
> >
> > if (mail($username." <".$email.">", $mailsubject, $body,
> > "From:
> > ".$Fromname." <".$Fromaddress.">\nContent-Type: text/html;
> > charset=iso-8859-1
> > "))
> >
> > All works fine, except when a particular line in the html file is
unusually
> > long.
hello,
you could use object buffering instead.
ob_start();
include 'your_page';
$body=ob_get_contents();
ob_end_clean();
This is how I send pages from my site in html to a mail address all the
time.
brett