A quick post on how to send spam e-mail using a PHP method. Also, don’t use this form as a normal contact form as it has no security built in.
NOTE: First in some cases the client will receive an e-mail that looks spoofed. In this case you can make an e-mail look like it has been sent from someone other than you. Second, in some cases the client will receive an e-mail from your server. In either case DO NOT USE THIS MALICIOUSLY because….it’s very easy to be caught. If someone were to examine the details of the e-mail in either case it would show your server and you would be traceable.
<code>
<!— sampleSpamForm.php
Note: All of this code should be placed on a single page. If you look below you will see that the form will post to itself, after the post if the email field is set then it will send the email. If not then it will display the form.
—>
<?php
if (isset($_REQUEST['email']))
//if “email” is filled out, send email
{
//send email
$to = “email to send to”;
$from = “email you want the email to appear to be sent from”;
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
$headers = “From: $from”;
$body = “$message $name”;
mail($to,$subject,$body,$headers);
echo “Thank you $name for using the spam form.”;
}
else
//if “email” is not filled out, display the form
{
echo “<form method=’post’ action=’spam.php’>
Name: <input name=’name’ type=’text’>
<br>
Email: <input name=’email’ type=’text’>
<br>
Subject: <input name=’subject’ type=’text’>
<br>
Message:
<br>
<textarea name=’message’ rows=’15′ cols=’40′> </textarea>
<br>
<input type=’submit’ />
</form>”;
}
?>
</code>



