Re: Putting a line feed in an email

From: Date: Mon, 27 Sep 2004 16:18:11 +0000
Subject: Re: Putting a line feed in an email
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-197972@lists.php.net to get a copy of this message
On Mon, 27 Sep 2004 09:05:24 -0700, Brian Dunning <brian@briandunning.com> wrote: > I'm sending a regular text email with a mailto:link like > this: > > <?php > > $subject = 'My Email Subject'; > $body = 'My Email body'; > > echo "<a > href=\"mailto:?subject=$subject&body=$body\">"; > > ?> > > I want the $body to contain some line feeds mixed in with the text. > I've tried putting \n, \r, and things like that in there, but they just > display in the text. Anyone know a way I can do this? I'm using the > mailto: method for its simplicity and client-side nature, > because I > want their email program to be responsible for servers, bouncing, etc. > Enclose the $body in double quotes. If you use single quotes, the \n, \r and other escaped characters are not parsed by PHP. Only strings delimited by double quotes get parsed by PHP. Regards, Jordi

« previous php.general (#197972) next »