Introduction
I will describe simple mail In PHP. For sending mail in PHP, I am using the mail() function. This function accepts five parameters. I have designed a simple contact mail form and sent mail from localhost. PHP e-mail code is used here. This code uses configuration settings in the php.ini file. With PHP you can create contact forms on your website. The mail() function is part of the PHP core.
Syntax
|
mail($to, $subject, $message, $headers); |
| Parameter | Description |
| To | Indicates the Receiver. |
| Subject | Specific subject of the E-mail. |
| Message | Define the message to be send. |
| Headers | Additional headers like, From, Cc, and Bcc. |
Example
<?php
if(isset($_POST["Submit"])){
$to = "[email protected]";
$subject = "Contact mail";
$from=$_POST["Email"];
$message=$_POST["Message"];
$headers = "$from"; mail($to,$subject,$message,$headers);
echo "Email successfully sent.";
}
?>
<html>
<head>
</head>
<body>
<form name="form" method="post" action="" >
<table bgcolor=#ffffcc align=center>
<tr><td colspan=2><strong>Contact us using this form:</strong></td></tr>




Kuppurasu NagarajPosted Apr 9, 2016, 10:49 AM
Nice