We'll mainly be using the mail() function for now. The mail() function basically allows you to send someone an email through PHP.
Here's a quick example:
[php]<?php
$to = "someone@domain.com";
$subject = "Test";
$message = "Hi!";
$mail = mail($to,$subject,$message);
if(!$mail)
{
echo 'Mail Sent!';
}else{
echo 'Error sending mail!';
}
?>
[/php]
Explanation:
We start off by assigning the basic values like to, subject, and the body of the email to their respective variables. Then we pass them to the mail() function (syntax: bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] ) ), which fires it off to the receiver.
And that about sums it up! Easy right?