I'm been looking online for sometime now and haven't really found anything that helped. Bascially my question is: Is there anything else I need to add to my php.ini file or on my Exchange server to allow me to recieve email since I'm not getting email currently from my form?

Information -----------
I have a Windows 2003 Server with IIS6 installed along with PHP. I have a contact form located on this server and when submitted, it goes to a PHP script (located in same directory) which sends the form information to my email address. Form is a basic one that just has a Question box.

Our email server is a Windows 2003 Server with MS Exchange 2007 running on it. Both of these servers are in the same domain and can ping each other with no problem. So from my reading, it sounds like the php.ini file would somehow talk to the Exchange server in order to submit the information to my email address.

PHP.ini Information ---------------
SMTP = mail.ourdomain.com
smtp_port = 25
sendmail_from = me@ourdomain.com

I found a php script online that tests if you can receive mail or not and once I generated the page, it said that mail could not be delivered.

$to = "me@ourdomain.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");

So from that, it obviously is that it can't send email. Anybody have suggestions that I can try.

Recommended Answers

All 2 Replies


I can't really see any reason why that wouldn't work.
The mail() function is always a bit hard to work with tho.

Try something like PHPMailer and see if you that works any better. You can set the SMTP info directly in the code and get it to output the SMTP dialog, so it is a lot easier to debug.

Are you sure that smtp has been enabled in exchange server ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.