Problem Diagnosing mail()

Discussion about the open-source Phalanger [?] project.

Problem Diagnosing mail()

Postby Drachen@codeplex » March 8th, 2007, 5:31 pm

Hi,

I'm having a problem diagnosing an issue with the mail() function in PHP on Phalanger 2.0 Beta 3. I have it installed on a Windows 2003 box with IIS6 using the local IIS SMTP server. I can successfully send mails from ASP.NET pages in the same application directory using the System.Net.Mail.SmtpClient class, so I'm sure the problem lies with my Phalanger config. Whenever I call mail(), it always returns 0 and no message or warning is logged or displayed on the page. It doesn't seem to be hitting my SMTP server because it's not appearing in the log. Any help diagnosing the problem or getting any more verbose error messages would be appreciated.

Thanks,
Andrew

Sample code:
mail("validemail@mydomain.com","Test Mail","This is just a test");

Relevant sections of the application's web.config:
<mailer>  <set name="SmtpServer" value="127.0.0.1" phpName="SMTP" />  <set name="SmtpPort" value="25" phpName="smtp_port" />  <set name="DefaultFromHeader" value="no-reply@mydomain.com" phpName="sendmail_from" /></mailer><error-control>  <set name="LogFile" value="f:\web\logs\php.log" phpName="error_log" />  <set name="EnableLogging" value="true" phpName="log_errors" />  <set name="DisplayErrors" value="true" phpName="display_errors" />  <set name="ReportErrors" phpName="error_reporting">  <set name="ReportErrors" phpName="error_reporting">    <add value="Error"/>    <add value="Warning"/>    <add value="Notice"/>    <add value="Strict"/>    <add value="UserError"/>    <add value="UserWarning"/>    <add value="UserNotice"/>    <add value="ParseError"/>    <add value="CompileError"/>    <add value="CompileWarning"/>  </set></error-control>
Drachen@codeplex
 
Posts: 2
Joined: January 7th, 2012, 8:55 pm

RE: Problem Diagnosing mail()

Postby tomasp » March 28th, 2007, 1:10 am

Hi,
I don't understand why you didn't get any error message - isn't error reporting disabled in the code later?

The reason why it doesn't work might be that you included <mailer> node directly in the <phpNet>, but it should be inside <bcl> node:
<configuration>    <phpNet>    <bcl>      <mailer>        <set name="SmtpServer" value="192.168.0.1" phpName="SMTP" />        <set name="SmtpPort" value="25" phpName="smtp_port" />        <set name="DefaultFromHeader" value="no-reply@mydomain.com" phpName="sendmail_from" />      </mailer>    </bcl>  </phpNet></configuration>	
tomasp
 
Posts: 46
Joined: January 7th, 2012, 8:37 pm

RE: Problem Diagnosing mail()

Postby Drachen@codeplex » March 28th, 2007, 6:20 pm

That was indeed the problem.

Thanks, Tomas!
Andrew
Drachen@codeplex
 
Posts: 2
Joined: January 7th, 2012, 8:55 pm


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 6 guests

User Control Panel

Login

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 511 on April 27th, 2024, 10:11 pm

Users browsing this forum: No registered users and 6 guests