hi cormac,
willing to learn eh? have a look at the below code, its a 'form' which will sit on your webpage first, then the php file that makes the magic! its very straighforward but its a start, you can just copy and paste this code if you want but i suggest you try to understand whats happening. i'll try to comment it as much as i can to help you understand
first, this code is the form which you place wherever you want on your webpage
HTML Code:
<form method="post" action="mailer.php"><br /> <!-- note the name of the php file -->
<input type="text" name="name" size="20"> <br />
Your Name<br />
<input type="text" name="email" size="20"><br />
Email Address<br />
<input type="submit" name="submit" value="submit"></form>
next is your php file which in this case we called mailer.php
PHP Code:
<?php
if(isset($_POST['submit'])) { //checks to sit if submit button has been used
$to = "you@you.com"; //enter the email address that you want info sent to here
$subject = "newsletter signup"; //email subject
$name_field = $_POST['name']; //retrieves users name
$email_field = $_POST['email']; // retrieves users email address
$body = "From: $name_field\n E-Mail: $email_field\n ";
echo "You have signed up for our Newsletter!";
mail($to, $subject, $body);
} else {
echo "There appears to be an error. please try again ";
}
?>
and there you have it, its very basic and doesnt redirect users back to the same page but you can figure that bit out yourself!!