title: PHP mail() relay to mail server
body: <p>I noticed a couple other posts around that were similar to my problem but found that they weren't specific to my scenario or I am just not understanding things very well.</p>
  
  <p>My situation:  I am trying to send mail from a LAMP server using the PHP mail() function.  I want to relay the mail to another dedicated mail server.</p>
  
  <p>Problem:  It seems I am not able to send mail...sometimes.  Sometimes it seems capable of sending mail to accounts outside of the domain but it fails to send any mail to accounts within the domain/network.  I have seen logs often complaining about it not being able to authenticate to the domain controller...but it shouldn't have to worry about that should it?</p>
  
  <p>I guess the part I am confused about is does the PHP mail() function automatically create an SMTP message to the server?  Or do I have to set the php.ini settings to look at the localhost and then configure sendmail/postfix to send the message to the mail server.  Also, why would it bother to authenticate with the domain controller if I only specified that the LAMP server try to connect with the mail server?  </p>
  
  <p>Hopefully someone can help me get this sorted out.  It's been bothering me for a while now and haven't been able to find a solution.
  Thank you,</p>