Send Mail using PHP

The mail() function used to send an email in PHP.

Syntax :
Parameter Description
to (Required) Receivers of the email
subject (Required) Subject of the email
message (Required) Message to be Send.
Lines should not be more than 70 characters. Each line should be separated with CRLF(\r\n).

Note(Windows Only): Replace Single dot with double dot. Because if a single dot found on the beginning of a line, it is removed.
headers (Optional) It's used to add extra headers like From, Cc and Bcc.
parameters (optional) Specifies an additional parameter to the sendmail program.

The following example shows, how to send email using PHP mail() function.

Example :
  $to = "";

  $subject = "Mail with PHP";
  $message = "<h1>Simple Mail.</h1>";
  $message .= "<h1>This is HTML message.</h1>";
  $header.="Content-type:text/html; charset=iso-8859-1";  

    echo "Mail send Successfully";
    echo "Mail send Failed!!!";