Hey all.
I'm trying, rather unsuccessfully, to get my PHP script to send email via IIS SMTP server. I have the following code in my email class:
// methods
function send() {
$this->emailHeader = "From: IIS@localhost";
if(mail($this->recipient, $this->subject, $this->message, $this->emailHeader)) {
return TRUE;
} else {
$this->error = "[ERROR:] Could not locate SMTP server!<BR>\n";
return FALSE;
}
return TRUE;
}
Now whenever this method is run I get the following error:
##########################################
"Warning: Server Error in D:\Inetpub\wwwroot\EmailTest\lib\email.obj on line 72"
##########################################
Where line 72 is the "if(mail..." line.
I assume that the SMTP server is responding to some degree as I get the following entries in the SMTPSVC1 log file:
##########################################
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2003-04-11 15:06:06
#Fields: date time
2003-04-11 15:06:06
2003-04-11 15:06:06
2003-04-11 15:06:06
##########################################
I'm completely new to using SMTP with PHP, so can anybody give me any suggestions as to the possible causes and solutions to such a problem? There must be come setting I have missed, but I don't know where to begin.
Regards.
Steve.