I am using PHP 4.3 on a Linux box using Apache 1.3.27.
Problem is that when I send mail using the < somemail@somedomain.com> the somemail@somedomain.com disappears so there is no email address to forward the mail to, however if I remove the < and > the somemail@somedomain.com is there but the mail server does not send the mail. $TO = " \"$row[name]\" <$row[email]>\r\n"; DOES NOT WORK echo "$TO" gives "Name" returns $TO = " \"$row[name]\" $row[email]\r\n"; WORKS give "Name" email@email.com but I get this server error "Name" email@email.com: missing or malformed local part (expected word or "<")
$to = $row['name'] . ' <' . $row['email'] . '>'; $subject = 'this is the subject'; $message = 'this is the message'; mail ($to, $subject, $message);
Now cooking with gas!!