mail() function is used to send emails from inside a script in php. The Syntax of mail() function is as under.mail(to,subject,message,headers,parameters)
| Parameter | Description |
| to | Required. Specifies the receivers email |
| subject | Required. Specifies the subject of the email |
| message | Required. Contain the message to be sent. Each line should be separated with a Line Fed (\n). Lines should not exceed 70 characters |
| headers | Optional. Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF (\r\n) |
| parameters | Optional. Specifies an additional parameter to the sendmail program. |
$to = 'noname@testing.com';
$subject = 'E-mail subject';
$message = 'E-mail message';
$headers = 'From: webmaster@studiesinn.com' . "\r\n" .
'Reply-To: webmaster@ webmaster.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>