Posted By

jprochazka on 10/02/10


Tagged

email


Versions (?)

Send an email. (simple)


 / Published in: PHP
 

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

  1. <?php
  2. function sendMail($from,$to,$subject,$body)
  3. {
  4. $headers = "From: $from";
  5. $headers .= "Reply-To: $from";
  6. headers .= "Return-Path: $from";
  7. $headers .= "X-Mailer: PHP5\n";
  8. $headers .= 'MIME-Version: 1.0' . "\n";
  9. $headers .= 'Content-type: text/html; charset=utf-8' . "";
  10. @mail($to,$subject,$body,$headers);
  11. }
  12. ?>

Report this snippet  

You need to login to post a comment.