Codeman Posted June 26, 2015 Share Posted June 26, 2015 Hi all, I don't know if this is the right place for this but here goes, I'm having a problem here I hope you can help with, I've got a web server using iis6 and php, php config is setup to use my sbs2008 SMTP server to send email. My problem is that about 7 times out of 10 the email fails but sometimes it works fine. I've actually got owncloud setup but when it comes to sending an email its very intermittent. I wonder if there's a way to diagnose what's happening or if someone has seen this before. Quote Link to comment https://forums.phpfreaks.com/topic/297057-php-and-smtp-problem/ Share on other sites More sharing options...
mac_gyver Posted June 27, 2015 Share Posted June 27, 2015 (edited) you would need to check the mail server's logs to find out what is actually happening. it is either deciding not to send them (usually due to relaying restrictions combined with what the to: and from: email addresses are) or the receiving mail server is refusing them or deciding not to process them (if they are invalid or the receiving mail server cannot confirm that your mail server is authorized to send email from where the mails stay they are from), or the receiving mail server is considering them spam/junk and is placing them into the junk mail folder of the recipient. if the mail server is returning an error to php, the mail() function should returning a false value that you can test for. if the mail server is returning error information to php, you can either echo or log the php errors to find out more information. are you sending an email to yourself, i.e. a mail box at your mail server or are you trying to send the emails through your mail server to other/external mail servers? also, in the cases where it doesn't work, what sort of error or symptom are you getting? Edited June 27, 2015 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/297057-php-and-smtp-problem/#findComment-1515065 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.