title: php mail function not sending emails / taking too long to send emails
body: <p>I have a rackspace cloud where I want to set up LAMP. the server has CentOS. </p>
  
  <p>I have sendmail installed and the php mail function use this, but it takes too long to send an email using the php mail function</p>
  
  <pre><code>&lt;?php
  
  ini_set('display_errors', true);
  error_reporting(E_ALL);
  
    $to = "email@somedomain.com"
    $subject = "activation code";
    $message = "Activation code: 10";
    $from = "activate@mywebsite.com ";
    $headers = "From: $from";
    if(mail($to, $subject, $message, $headers)) { 
        echo 'success'; 
    }
    else { echo 'deny'; }
  </code></pre>
  
  <p>but this takes a lot of time, and when I ask rackspace about this they said the mail function might be using a public mailserver to send emails and as the queue is too long it takes time. but I have another email server too. </p>
  
  <p>is there anyway I can get this to work fast? and can I make the send mail installation to use that email server I have ?</p>