1) Sample PHP Form Code:
HTML Code:
<form action="phpsend.php" method="post">
Your Name:<input type="text" name="name" />
E-mail:<input type="text" name="emai" />
<input type="submit" value="Submit">
</form>
2) Create a file called phphsend.php with following code (modifying with your address):
PHP Code:
<?php
//Declare the variables of your form
$recipient = "USER@YOUR-DOMAIN-HERE.COM";
$subject = "Testing.. 1 2 3";
$message = "Hi there!";
$from = "PHP mailer test";
//Contents of form
$name= $_POST['name'];
$email = $_POST['email'];
//mail() function sends the mail
mail($recipient,$subject,$message,$from," -f [email]VALID-USER@THISDOMAIN.COM[/email]);
?>
NOTE: -f
VALID-USER@THISDOMAIN.COM needs to be a valid user on the local domain so that it will be able to send