james130c
asked on
Using a php web form to send data to the user who filled it out, problems.
Hi, i have a web form that works and everything, but the input entered by the user is sent to their email address to confirm what they have entered. This is all fine, but they are having problems finding this email as it comes from 'root@gamma.control-access 12.com ' which i believe is the server default for my hosting account. How can i have it say the email is from for example (myemailaddress).
$success = mail($EmailFrom, $Subject, $Body, $body_text, "From: MyEmailAddress@domain.com");
( i have tried using my e-mail address in the From: bit... no luck still displays the above root@gamma.control-access12.com)
How can i get around this problem? other than that all is fine, but nobody can ever find the mail as who would want junk mail from root@gamma, ect...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mail() takes at most 4 arguments. You were passing 5. The fourth argument is supposed to be headers. Since mail takes at most 4 arguments and the 4th argument is supposed to be the headers, you were correct in supplying the headers in the last argument. Your mistake was really passing 5 instead of 4 arguments. I "joined" your original third and fourth arguments with newlines spacers.
ASKER
ok thanks for clearing that up, superb.
ASKER
Thanks.