This topic is locked

SMTP Mail failing

4/28/2015 8:57:47 AM
PHPRunner General questions
B
bcritchley author

I have a PHP page that is supposed to send a simple SMTP email when a new record gets added to the database. It has been working well up until two days ago and it is now intermittently not sending emails. Is there a log file in PHP that shows the status that I can use to try and track down where the issue might be?

Sergey Kornilov admin 4/28/2015

If there are any errors they should be displayed on the page. Try to add a record and see what happens.
There is also PHP error log but I doubt you find something useful there:

http://stackoverflow.com/questions/5127838/where-does-php-store-the-error-log
You may want to check mail server logs to see connect attempts from your PHP application.

D
DealerModulesDevClub member 5/1/2015

Most ?nix logs are stored at /var/log/maillog. You may want to check your firewall logs as well. Also some public server ISPs allow only so many SMTP's per day, maybe you are hitting your quota on a shared hosting account?
Just throwing out some ideas.
Paul

B
bcritchley author 5/6/2015

Please forgive my lack of PHP experience on this but I'll give more detail to my environment. I have a Windows server 2012 machine that has the PHP application and an MSSQL server dedicated to this app that I am having trouble with. In the PHP script I added the portion to send a simple email to the person requesting the service and also a bcc to me as notification that the request has been submitted. The emails are being sent through another SMTP server within the same company and behind the same firewall. I have been in contact with the IT staff and they have told me they will look in the log files, but I am not certain they know what to even look for. I was hoping to have some sort of way to log the steps or results from the sever side that I have control over to definitively show that the PHP runner piece is doing what it is supposed to but the failure is on the smtp server side. Any thoughts?

Sergey Kornilov admin 5/6/2015

You should not be checking any logs. The only log that makes sense is SMTP server log ad you do not have access to it. If there were errors most likely you would have seen them on the page. I would say that if even simple email fails that must be something on SMTP server side.
Here is what I suggest in order to troubleshoot this. Try another SMTP server that you know works for sure i.e. Gmail's SMTP. If you do not have a Gmail account simply create a new one. Point this project to Gmail's SMTP server, see if emails go through. That would be a first thing I would have tried.

B
bcritchley author 5/6/2015

Thank you I will try the option of switching to a different SMTP server.

:-)