Send email using php

Sending email from a PHP script on a web page is easy.

Send Email from a PHP Script

All it takes is the right configuration (to send mail using a local or a remote server) and one function:

mail()

Use Custom Headers (e.g. “From:”) in Mail from a PHP Script
Do you want to set a custom From: address, maybe taken from the form you send, or another custom header line? It is but an additional argument you need.

Use below code send email using custom header