This is an example, that how can you add SMTP relay in your php mail() function. There are some points you have note:
- You have you use your own website webmail email id in "from".
- You need add your your webmail email id username, password and host. You can use localhost as well in example.
- $headers should be an array
- You have install Mail throw PEAR in your CPanel.
- Include Mail.php file and php folder path as example.