How to send e-mail using PHP

Use the mail() function.

You can see if your website supports it by testing with the following example:


<?
  $to = "tester@test.com";
  $from = "php@test.com";
  $subject = "test php mail function";
  $message = "this is a 2\n line message.";

  if ($from) {
    $headers .= "From: $from";
  }
  if (mail($to, $subject, $message, $headers)) {
    print "mail sent succesfully to $to";
  }
  else {
    print "mail send failed!";
  }
?>