The mail() function allows in sending emails directly from a script.
to − The receiver / receivers of the email
sub − The subject of the email.
msg − The message to be sent.
headers − The additional headers, such as From, Cc, and Bcc.
parameters − The additional parameter to the sendmail program. This was added in PHP 4.0.5.
The mail() function returns the hash value of the address parameter, or FALSE on failure.
The following is an example to send an email −
<?php $msg = "This is demo text!"; $email_msg = wordwrap($msg,40); mail("firstname.lastname@example.org","Subject Line",$email_msg); ?>