title: SMTP email using Exchange server from web application
body: <p>I have a site that uses SMTP to send outgoing messages, but I'm having trouble integrating this with our exchange server.</p>
  
  <p>I have an external company which hosts our exchange server, so when I setup our web site I set in the web hosts MX record to point to our exchange server. Now all emails that go to our domain get shuffled along to our exchange server, which works well.</p>
  
  <p>The problem is that when I set my webhost to use the custom MX record, it switches off all email services they provide, which includes SMTP email. Now that I am setting up some forms which will use SMTP, it seems like I can't send outgoing mail.</p>
  
  <p>So, with this kind of setup in mind, would it be crazy to assume that if I tell the SMTP server to send using <em>localhost</em>, it would look at the MX record and find the exchange server and use <em>that</em> to send the email? Or should I still be pointing it somewhere specific? </p>
  
  <p>This might sound like I'm asking a question specific to the webhost, but I'm wondering more about the general idea of how a setup like this normally works. </p>
  
  <p>Thoughts?</p>