<?php
$name = $_POST['name'];
$email = $_POST['email'];
$body = $_POST['body'];
if ($name != "" AND $email != "" AND $body != "") {
//PUT YOUE EMAIL ADDRESS -----
$sendto = "my email";
//PUT YOUR EMAIL ADDRESS -----
$subject = "Email from site!";
$message = "This is a message from your site
From: $name
Email: $email
Message: $body";
// send the mail
mail("$sendto", "$subject", "$message");
echo "Your message was sent";
}
?><form method="post" name="mailform" action="<?=$_SERVER['PHP_SELF'] ?>">
<table width="200" border="0" cellspacing="0">
<tr>
<td width="62">Name:</td>
<td width="134">
<input name="name" type="text" id="name">
</td>
</tr>
<tr>
<td>Email:</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea name="body" cols="45" rows="10"></textarea></td>
</tr>
</table>
<br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</form>
The problem that I am having with this is that every time I send a email from this form I get an email from Apache. This is the email address: apache@webdev.jgi.co.za
The address of the testing server that I am using is http://webdev.jgi.co.za.
Can anyone explain what I am doing wrong. I want this email to come from something like nonreply@*****.***

New Topic/Question
Reply



MultiQuote






|