I have a strange effect:
From a formula I transfer firstname, lastname and email address to a PHP
script. Then mail() shall send this data.
$mailheaders = "From: ".$_POST['firstname']." ".$_POST['lastname'].
"<".$_POST['email'].">\n";
$mailheaders .= "Reply-To: ".$_POST['email'];
mail($_SESSION['recipient'], $_SESSION['subject'], $body, $mailheaders);
Most times this works quite well: A blank is "usually" between first name
and last name. But: If the first name is abbreviated with a point, then the
blank is suppressed in the sent mail.
Correct:
Firstname: Nik
Lastname: Futter
EMail: eMail
changes to: Nik Futter <eMail>
But:
Firstname: N.
Lastname: Futter
EMail: eMail
changes to N.Futter <eMail>
Or (extreme example)
Firstname: F G
Lastname: Xtra Zeta
changes to: F G Xtra Zeta
Firstname: F. G.
Lastname: Xtra. Zeta
changes to: F.G.Xtra.Zeta
For checking I also have attached the variable $mailheaders to the body of
the sent email. At this stage the blank exist behind the dot.
Why this happens ? Is it an error in the script or in mail() ?