Problem Diagnosing mail()
3 posts
• Page 1 of 1
Problem Diagnosing mail()
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:
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()
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:
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()
That was indeed the problem.
Thanks, Tomas!
Andrew
Thanks, Tomas!
Andrew
- Drachen@codeplex
- Posts: 2
- Joined: January 7th, 2012, 8:55 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests