Jump to content

Php and SMTP problem

Recommended Posts

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.

Link to comment
Share on other sites

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 by mac_gyver
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.