Not showing whole name with mail () script

Posted on 16th Feb 2014 by admin

I sent up a simple mail form with the PHP mail() script. One problem is when it sends an email with the form's contents, the From header only reads the first name and shows @domain.com in the From column.

Example:

A user inputs "John Smith" into the form as their name.

When the email arrives in my inbox it's say "John@yahoo.com", the domain name depends on which email I'm using, could say "John@hotmail.com" if I had a hotmail email address. It basically ignores the "space" and "Smith" in the name input part of the form and replaces it with "@domain.com".

How can I get it to put the whole "John Smith" instead? FYI: I'm very new to this, so not sure if this is considered an "easy fix" or not.

Thanks!

Other forums