Send Mail in PHP

Using the PHP Mail function is the simplest method to send email through PHP.

The code below gives a basic example of the syntax and use of the PHP mail function.

$message = $_REQUEST['message'] . "\n\n\n";
$message .= $_REQUEST['name'] . "\n" . $_REQUEST['email'];

"You are a winner!",
"From: {$_REQUEST['email']}\r\n");

Sending mass e-mails using the PHP mail function is neither elegant or recommended. There are a few scripts out on the web that will help with this, some commercial, some free.