title: spoofing mail.php on DreamHost
body: <p>I'm very new to php and am having trouble with my send-mail.php file which is being hosted on dreamhost. 
      
  
  <pre><code>// site owner
  $to = trim( $_POST['to'] );
  $subject = trim( $_POST['subject'] );
  
  // contact form fields
  $name = trim( $_POST['name'] );
  $email = trim( $_POST['email'] );
  $message = trim( $_POST['message'] );
  
  
  // check for error
  $error = false;
  
  if ( $name === "" )
  {
      $error = true;
  }
  elseif ( $email === "" )
  {
      $error = true;
  }
  elseif ( $message === "" )
  {
      $error = true;
  }
  // end check for error
  
  // no error send mail
  if ( !$error )
  {
  
      $body = "Name: $name \n\nEmail: $email \n\nMessage: $message";
  
      $headers = 'From: ' . $name . ' &lt;' . $email . '&gt; ' . "\r\n" . 'Reply-To: ' . $email;
  
      mail( $to, $subject, $body, $headers );
  
      echo 'success';
  
  }
  else
  {
      echo 'error';
  }
  // end no error send mail
  ?&gt;
  </code></pre>
  
  <p>So this won't work on DreamHost because of their anti-spam filters. </p>
  
  <p>They said this  </p>
  
  <pre><code>The FROM address needs to belong to the domain (ie @mydomain.ie)
  Once that is changed in the form settings, mail should be able to send correctly. This change was done to help prevent spam that was coming from the server:
  
  http://dhurl.org/20b
  
  If you would still like to keep the user inputted e-mail address, you would need to set it to be the REPLY-TO address instead of the FROM address.  
  </code></pre>
  
  <p>I'm totally new to php and every time I try to edit the code, with reference to the DreamHost wiki, I end up breaking the thing!</p>
  
  <p>I would really appreciate it if someone could help me out. </p>