Re: Truncating Lines
| From: | DL Neil | Date: | Thu, 25 Oct 2001 23:23:21 +0000 |
| Subject: | Re: Truncating Lines | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72370@lists.php.net to get a copy of this message | ||
Please define "long", and perhaps think of that in the context of the RFC ?822 is it?
=dn
----- Original Message -----
From: "BT News" <hostmaster@wirestation.com>
To: <php-general@lists.php.net>
Sent: 25 October 2001 17:38
Subject: [PHP] Truncating Lines
> Hi,
>
> 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. Where this is the case, the mail gets sent but the long line truncates
> (the last character on the line being ! (exclamation mark)) followed by the
> remainder of the line on a new line. This obviously causes problems when
> trying to display the HTML.
>
> Strangely though, if the recipient of the mail is a local user (i.e. a user
> residing on this box), the line does not truncate and the HTML source
> remains intact. Equally, if I write out the contents of $body to the screen,
> the HTML source is intact.
>
> I suspect Sendmail may be the culprit, but I'm not sure.
>
> I realise I could keep my HTML source lines to a certain length, however
> these are often created dynamically so it's not that straight forward.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>