Page 1 of 1

Creating a string that contains < character

Posted: Sun Jul 11, 2004 7:42 pm
by dickey
I wish to create a string containing the < char for use with mail().

eg "First Name Last Name <username@domainname>"

I'm using an array ($list) containing data from a mysql table (fname, lname, email)

Why doesn't this work?

$to = '"';
$to .= $list['fname'];
$to .= ' ';
$to .= $list['lname'];
$to .= ' <';
$to .= $list['email'];
$to .= '>"';

It bombs when it hits the < char.

Any assistance appreciated.

- Andrew

Posted: Sun Jul 11, 2004 8:16 pm
by feyd
it depends on where you are passing the $to variable.. if you are passing it outside the headers of the mail, then yes, it should fail. Only the email address being sent to is supposed to be in the "to" argument of mail.. last I checked anyways..