I am experiencing unexpected results when using the PHP mail function. I am sending the email with the header: $mailheader = 'From: Sou Desade' . "\r\n" . 'Reply-To: firstname.lastname@example.org' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
I also tried it without the extra 'X-Mailer: PHP/' . phpversion(), not sure why these are necessary at all. But the result is the same.
When the email comes through it says, in the 'from' field: "Sou@subdomain.hostingprovider.com; Desade@subdomain.hostingprovider.com"
I substituted subdomain.hostingprovider for the real address for the purposes of this post. The subdomain showed isn't even mine, but for the provider's account manager. I am new to PHP, do you know how I can get it to show "Sou Desade" in the from field? I tried 'From: "Sou Desade"' with the " signs, but it just showed up as "Sou Desade"@subdomain.hostingprovider.com
I contacted the provider in case it was an issue with the settings of the server but they said the issue was with the script and didn't offer much more help than that.
Hey thanks for the warm welcome and the words of wisdom! :) Would you mind also telling me something else? Do you know what the 'X-Mailer: PHP/' . phpversion() does? Is it something to do with the spam filters?
Welcome to WebmasterWorld bugsquish (i like that nick ;)),
I would actually remove that line. All it does is put your version # of php in there, I have never been a fan of adding extra headers that don't do anything, though I have had this in some of my mail scripts when I needed to do some things.
also the line is not properly terminated anyway, it should look like this