Return to Snippet

Revision: 32754
at November 6, 2012 08:40 by jprochazka


Updated Code
<?php
function sendMail($from,$to,$subject,$body)
{
  $headers = "From: $from";
  $headers .= "Reply-To: $from";
  headers .= "Return-Path: $from";
  $headers .= "X-Mailer: PHP5\n";
  $headers .= 'MIME-Version: 1.0' . "\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "";
  @mail($to,$subject,$body,$headers);
}
?>

Revision: 32753
at April 5, 2011 03:59 by jprochazka


Updated Code
<?php

function send_simple_mail($from,$to,$subject,$body)
{
  $headers = "From: $from
";
  $headers .= "Reply-To: $from
";
  headers .= "Return-Path: $from
";
  $headers .= "X-Mailer: PHP5\n";
  $headers .= 'MIME-Version: 1.0' . "\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "
";
  @mail($to,$subject,$body,$headers);
}

?>

Revision: 32752
at October 2, 2010 01:36 by jprochazka


Updated Code
<?php

function send_simple_mail($from,$to,$subject,$body)
{
  $headers = "From: $from
";
  $headers .= "Reply-To: $from
";
  headers .= "Return-Path: $from
";
  $headers .= "X-Mailer: PHP5\n";
  $headers .= 'MIME-Version: 1.0' . "\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "
";
  @mail($to,$subject,$body,$headers);
}

?>

Revision: 32751
at October 2, 2010 01:36 by jprochazka


Initial Code
<?php

function send_simple_mail($from,$to,$subject,$body)
{
  $headers = "From: $from
";
  $headers .= "Reply-To: $from
";
  headers .= "Return-Path: $from
";
  $headers .= "X-Mailer: PHP5\n";
  $headers .= 'MIME-Version: 1.0' . "\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "
";
  @mail($to,$subject,$body,$headers);
}

?>

Initial URL


Initial Description
A simple example of how to send an email using PHP's build in mail() function.

Initial Title
Send an email. (simple)

Initial Tags
email

Initial Language
PHP