Apache was trying to handle the email locally on our server. When I looked at the log response I saw it was returning the following error.
User unknown
550 5.1.1 recepient@example.com
After following these steps the email was routed to the correct mail server. My setup is Ubuntu 12.04 with PHP 5 Apache2 and Sendmail.
Edit the sendmail config file on the Apache server:
sudo nano /etc/mail/sendmail.mc
At the end of the file add the following lines of code to handle email correctly:
define(`MAIL_HUB', `example.com.')dnl define(`LOCAL_RELAY', `example.com.')dnl
Save the file and exit.
Update the sendmail setup in the command prompt:
sudo sendmailconfig
Follow the steps, I said yes to everything
Restart sendmail:
sudo service sendmail restart
Try sending the email again. It should work now.