I’ve got an issue, that is driving me crazy.
We have a PHP contact form on our websites. Recently it’s been pointed out that when an email was received it was changing the suffix of the email address, to the domain the form was being sent from.
i.e. if the domain was doamin1.com but the email address from the form was “[email protected]” the email would arrive as “John Smith [email protected]”
The code in the header line was
$header = "From: " . $name . "<". $email .">rn";
I changed it to the following, hoping that it would then see the email address, and we’re not overly bother about it not showing “$name” outside of the <$email> and we’re still having some issues, but it’s slightly better.
$header = "From: " . $email . "<". $email .">rn";
The from address now shows as “johnsmith429” [email protected]. Which is better, but not perfect.
I know it will be something little I’m missing, if someone can assist that would be perfect, thank you.
Thanks
Andy
Changed code from:
$header = "From: " . $name . "<". $email .">rn";
to
$header = "From: " . $email . "<". $email .">rn";
now showing the correct email address in the second part between the “< >”, but with the domain again at the front of the email address.
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.