View Single Post
Old 26-06-2009, 15:40   #8
Walford
Inactive
 
Join Date: Apr 2009
Location: Bristol
Services: 10MB Broadband from VM
Posts: 110
Walford is on a distinguished roadWalford is on a distinguished road
Re: Automatic mail on PHP web page?

Quote:
Originally Posted by Cobbydaler View Post
This is a simple php mail() function script

Code:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
I guess you just stick it in as a script that runs when the page is visited. Not sure about the session cookie thing though...

Thanks. I have used this one as it gives the option of a 'from' address.

Thanks for all your help though.

Jack :-)
Walford is offline   Reply With Quote