Link to home
Start Free TrialLog in
Avatar of james130c
james130cFlag for United Kingdom of Great Britain and Northern Ireland

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-access12.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...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of james130c

ASKER

Thank that has worked great! Could you explain to me by fourth argument what you meant? how did you work out why it was wrong? Just want to understand the code a bit more as to why mine wasn't working.

Thanks.
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.
ok thanks for clearing that up, superb.