Right, i’m new to PHP and mySQL, but i’ve got a few questions that i hope some of you guys can answer because this is confusing me right now.
(I’ll still try to read up more on google to see if i can find any answers whilst this is going on, so if i find any, i’ll post my own answers up here as well)
- I want a feedback form on my site. I’m looking at the PHP Email Forms but i’m kind of confused here —
On the API, it says that for someone to send an email to me, the php script needs to enter and send this code:
mail(to,subject,message,headers,parameters)
However, i realise there is no “from” argument inside this function. Why is this so? How will i be able to find out the email of the other person and be able to reply to him/her via my own email after receiving such a feedback request?
I’m also reading on parts where people include the sender’s email into the “headers” argument itself. How will a mail system gather that there is a sender’s email if i include this inside the “header” argument? (I’m asking this part because my webhost provides an auto-reply before i reply, and i want it to be able to recognize that the sender’s email is the email that the system should auto-reply to)
Would it be easier to just put a mailto:email@email.com link on the webpage?
I think that’s pretty much all i’m trying to find out for now, i have more complex questions but i think i’ll try to solve the easier ones first.
Check out php mail in the manual
Example from the manual
Update:
You also asked about putting the name in the from address. To do this just change the From: in the headers to
WEBMASTER NAME <webmaster@example.com>