This function uses the server's smtp as defined in the php.ini
i saw this function at www.w3schools.com also but didnt used it properly.. then somebody told me that for this u have to install email server also... so i got confused about that....
i hope for this mail(....) function i dont have to use any server type thing.... just by using this my message will be sent to the particular email address?
If you are using a web hosting service(a virtual server) then everything should be set up and it will work if you code it correctly. If you are running on your own local server using WAMP or EASYPhp or another similar test environment, then you won't have a mail server and isn't simple to get that working.
Setting up a secure email server to send and receive isn't something for an amateur. A quote:
"If you know absolutely nothing of internet protocols like pop, smtp, imap, etc. do not host your own mail server. A newbie server, if you can get it up and running will be completely insecure. their are millions of spam bots out there troll the internet looking for insecure smtp servers they can use to send their spam from. you could get into some big problems if your isp finds that you are sending spam from your computer. so, unless you know how to secure your mail server dont even think of installing one. and dont think if you read "email servers for dummies' you will know anything about email server security. that is up to experienced system admins."
If you just want to send mail or test the output from a send, then there are a number of ways to do that. It is a more complicated task to install a mail server for two way traffic (and make it secure).