This topic is locked
[SOLVED]

  Email Messaging Not working

2/12/2011 11:56:47 AM
PHPRunner General questions
J
John author

I can't make the email function operate within PHPR v5.3 build 7113.
Recently I have started converting an ASPR application due to the increased performance inherent in PHP processing that used the built in email function which worked correctly under ASP v6.3 (build 7113). The same exact email settings did not work in PHPR.
I have created a rather simple test application that simply attempts to send the sample email to a user it always receive the ubiquitous message:
"mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()"
This seems to imply that SMTP settings need to be set in the PHP.INI configuration file but I thought these values should be passed from the SECURITY - LOGIN Settings - Email section of PHPR as they were with ASPR. In fact the only way the SMTP values change is if they are modified in the PHP.INI
I noted that PHPR is using the classes provided from PHPMAILER under the libs\phpmailer output folder but even when I deleted those classes I do not receive an error message. It appears that the classes are not being included.
The test enviroment is as follows:

  • Windows 7 (64bit version)
  • IIS 7
  • PHP v5.3
  • SMTP EMail authentication tested with and without



[mail function]

; For Win32 only.

; http://php.net/smtp

SMTP = localhost

; http://php.net/smtp-port

smtp_port = 25
; For Win32 only.

; http://php.net/sendmail-from

; sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").

; http://php.net/sendmail-path

;sendmail_path =
; Force the addition of the specified parameters to be passed as extra parameters

; to the sendmail binary. These parameters will always replace the value of

; the 5th parameter to mail(), even in safe mode.

;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
; The path to a log file that will log all mail() calls. Log entries include

; the full path of the script, line number, To address and headers.

;mail.log =
Can anyone share a copy of their working PHP.INI file ?
Thanks in advance
John

Admin 2/12/2011

John,
if you enter SMTP server settings in PHPRunner you should not change anything in php.ini. PHPMailer uses it's own SMTP implementation and doesn't rely on php.ini settings.
If you need help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

J
John author 2/12/2011

I wasn't certain if that was the case or not.
BTW: A sample has been there for a while. See Ticket 226535: Re: Using Email from PHPR .
Pls advise
John

Admin 2/14/2011

John,
this ticket was answered.

J
John author 2/14/2011

For anyone who was following this one, here is the solution:
Modify the PHPRunner5.3\source\include\phpfunctions.php
Find this line:

------------------------------

$customSMTP = "";

------------------------------

and replace it with this one:

------------------------------

$customSMTP = 1;

S
smith 2/19/2011

Thank you

the answer was very useful in one of my system with Gmail authentication. The Generated script work with one system but with another system with same config was not sending any mails. Now it is solved.

Thanks

Smith



For anyone who was following this one, here is the solution:
Modify the PHPRunner5.3\source\include\phpfunctions.php
Find this line:

------------------------------

$customSMTP = "";

------------------------------

and replace it with this one:

------------------------------

$customSMTP = 1;