• 1.
    <?php
  • 2.
     $to = "recipient@example.com";
  • 3.
     $subject = "Hi!";
  • 4.
     $body = "Hi,\n\nHow are you?";
  • 5.
     if (mail($to, $subject, $body)) {
  • 6.
       echo("<p>Email successfully sent!</p>");
  • 7.
      } else {
  • 8.
       echo("<p>Email delivery failed…</p>");
  • 9.
      }
  • 10.
     ?>
<?php $to = "recipient@example.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Email successfully sent!</p>"); } else { echo("<p>Email delivery failed…</p>"); } ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter