mail function does not work in 1.7.3 when it did in 1.6.3

Problems with the Windows version of XAMPP, questions, comments, and anything related.

mail function does not work in 1.7.3 when it did in 1.6.3

Postby RupertA » 18. January 2011 13:21

Hi,

First of all, I have spent at least the last hour using the search facility to look at similar posts and still can't resolve. My computer is windows xp pro. Had xampp 1.6.3 before. Have now upgraded to 1.7.3. Previously in 1.6.3, I had changed the php ini file to use the smtp for our internet service provider. This worked just fine for php emailing using mail function. Have now upgraded to xampp 1.7.3 and made the change in php.ini again. I have then stopped and restarted the apache server thru the xampp control panel. My php emails using the mail function do not send. Why would this be?

212.23.3.98 is the ip for zen - our internet provider

the entry in php.ini is

[mail function]
; For Win32 only.
SMTP = 212.23.3.98
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = postmaster@localhost

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; 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
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
mail.log = "C:\xampp\apache\logs\php_mail.log"


As you can see the mail log file is enabled and does write to it. However the email fails and does not send a basic test script email that I know would usually work. here is entry in mail log file

mail() on [C:\xampp\htdocs\email.php:14]: To: rupert_email@hotmail.com -- Headers: From: support@somecompany.com Reply-To: support@somecompany.com

Thanks for any help.
RupertA
 
Posts: 8
Joined: 13. January 2011 16:35

Re: mail function does not work in 1.7.3 when it did in 1.6.

Postby RupertA » 18. January 2011 13:55

ok, so i ran

Code: Select all
<?php

if ( function_exists( 'mail' ) )
{
    echo 'mail() is available';
}
else
{
    echo 'mail() has been disabled';
}

?>


and mail is available. But emailing is still not being sent.
RupertA
 
Posts: 8
Joined: 13. January 2011 16:35

Re: mail function does not work in 1.7.3 when it did in 1.6.

Postby RupertA » 18. January 2011 14:02

Now tried following........

<?php

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


?>

and it returned.....

Warning: mail() [function.mail]: Failed to connect to mailserver at "212.23.3.98" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\email3.php on line 7

Message delivery failed...

soo, any ideas what I could do?

thanks.
RupertA
 
Posts: 8
Joined: 13. January 2011 16:35

Re: mail function does not work in 1.7.3 when it did in 1.6.

Postby RupertA » 18. January 2011 15:14

from a command prompt I have done

telnet mailhost.zen.co.uk 25

from that I get "could not open connection to the host, on port 25: connect failed"

does this mean there is a problem with zen or that there is some configuration problem on mine with port 25? I find it hard to believe it is zen. emailing was working perfectly with my ISP until I upgraded my xampp.

thanks.
RupertA
 
Posts: 8
Joined: 13. January 2011 16:35

Re: mail function does not work in 1.7.3 when it did in 1.6.

Postby RupertA » 18. January 2011 16:29

Uninstalling the virus scanner, means it does now connect to the server, but now I get

Warning: mail() [function.mail]: SMTP server response: 530 Authentication required for RFC4409/MSA access. in C:\xampp\xampp\htdocs\email3.php on line 7

Message delivery failed...


Why am I now getting this? I never had this on version 1.6.3. All i had to do there was just change the mail function.
RupertA
 
Posts: 8
Joined: 13. January 2011 16:35

Re: mail function does not work in 1.7.3 when it did in 1.6.

Postby RupertA » 18. January 2011 18:43

Sorted it now. It was 2 things

1) mcafee virusscan enterprise was screwing it up, wouldn't allow connection.
2) I had uncommented a line in php.ini

sendmail_from = postmaster@localhost

put the colon back on the front there and it did not require authentication.

I include working php.ini here (the [mail function] part) for anybody looking in the future. Thanks.






[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = 212.23.3.98
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; 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
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "C:\xampp\apache\logs\php_mail.log"
RupertA
 
Posts: 8
Joined: 13. January 2011 16:35


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 42 guests