I need to send a notification e-mail to myself and a couple other addresses when a user of my site submits a php form that adds a row to one of my database tables. I've done some minor php coding, but this is the first time I've needed to set up a mail() event. The problem is the mail never gets through. I've tested if the mail() function itself is working properly, and it is.
I'm sure my problem is in the php.ini settings for sendmail. I'm not sure exactly what to set my SMTP to. I've tried "localhost", but I think because my site is set up on a vps from a hosting company (Verio), that won't work. I've set it to the IP of my exchange server, but that obviously doesn't work as well because a login is required. I found all the returned e-mails on my web server, and they all say that the address I'm trying to send to has fatal errors, yet I know for a fact that the address works.
I've done a lot of searching through the forum and found multiple postings regarding similar issues, but nothing that seemed to help me to understand what to set the SMTP to. Any help would be greatly appreciated.
Odd sidenote: any changes I make to php.ini don't seem to show up when I run phpinfo(). Acording to phpinfo() my SMTP is still set to "localhost" even though in php.ini it's set to "mx1.veriomail.com"
Turns out that it was all working the entire time. The problem was that there was a conflict because I was sending an e-mail from within the externally hosted "mycompany.com" website to an e-mail address "@mycompany.com." The e-mail exchange server is located here at the office. Therefore the webserver thought it was an internal e-mail, yet couldn't find any of the usernames that I was trying to send the e-mails to. The solution was to change the name of the server where the website is hosted, so that the e-mail would be sent outside of the server, then properly routed back to our own exchange server.