Hello @kartik,
PHP mail function can send email in 2 scenarios:
a. Try to send email via unix sendmail program At linux it will exec program "sendmail", put all params to sendmail and that all.
OR
b. Connect to mail server (using smtp protocol and host/port/username/pass from php.ini) and try to send email.
If php unable to connect to email server it will give warning (and you see such workning in your logs) To solve it, install smtp server on your local machine or use any available server. How to setup / configure smtp you can find on php.net
Hope it helps!!
Thank You!!