Ok been a while since I posted anything so thought I would post my tutorial on using the
PHP mail() function. I have basically copied my tutorial word for word from
the Lazarus forum.
This is a brief (or not) tutorial on using the
PHP mail() function to send emails from your scripts.
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
Let's break that down. The bool means that the
PHP mail function returns either
true or
false depending on if it was successful or not. The rest is pretty self explanatory.
string $to is where we put the email address we want to send to.
string $subject is where we put the emails subject and
string $message is where we put our message. The string part just means that this variable will be treated as a string when used. We will cover $additional_headers a bit later and won't even touch on $additional_parameters.
Ok so we want to send an email to
Bill Gates with the subject
Windows Linux and our message is
When is it coming out?. The function we would use looks like this
PHP:
<?php
mail('bill.gates@microsoft.com', 'Windows Linux', 'When is it coming out?');
?>