mattyilo wrote:...I have tried using include(), but instead of sending the body of the email to the user, it sends a blank email and you immediatly see the page that I have called to include in the browser.
that is precisely what [man]include[/man] does, it will evaluate the contents of a file and output the result. the "message" argument to the [man]mail[/man] function is just a [man]string[/man]. as such it can be dynamically created just like any other string. for example:
$message = 'the current date-time is ' . date('Y-m-d H:i:s');
$mail = @mail('mattyilo@mattyilo.com', 'date and time', $message);
if ($mail) {echo 'mail OK';} else {echo 'mail FAIL';}