Php Mail() not sending any emails out?
<p>I have a mail function</p>

<pre><code> $to = "fahad@somewhere.com";
 $subject = "Voucher Number: ".$voucher;
     $message = '&lt;html&gt;&lt;body&gt;';
     $message .= '&lt;table rules="all" style="border-color: #666;" cellpadding="10"&gt;';
     $message .= "&lt;tr style='background: #eee;'&gt;&lt;td&gt;&lt;strong&gt;Voucher#:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" . strip_tags($voucher) . "&lt;/td&gt;&lt;/tr&gt;";
     $message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Name:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" . strip_tags($name) . "&lt;/td&gt;&lt;/tr&gt;";
     $message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Phone Number:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" . strip_tags($product) . "&lt;/td&gt;&lt;/tr&gt;";
      $message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Email:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" . strip_tags($email) . "&lt;/td&gt;&lt;/tr&gt;";


//set content-type
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// More headers
$headers .= 'From: &lt;livingdeal@overstock-king.com&gt;' . "\r\n";
$headers .= 'cc:'. $email . "\r\n";

mail($to,$subject,$message,$headers);
</code></pre>

<p>For some reason I'm not getting any mail sent at all. The service is hosted so i'm not running it from localhost, and even when I write</p>

<pre><code>if (mail(....))
{ echo "success";
}
else { echo "failed"; }
</code></pre>

<p>I always get success, so my suspicion is that it is a problem on the server end. If php mail goes from port 25 is there any way to change the port to a different one in the script? or would it be in php.ini.</p>

<p>Also, would I be able to use a different server (that has a different domain) to send the mail without redirecting the use to that other webpage? I guess in other words can I connect to an smtp server through a php script before sending the mail?</p>
