php-windows Digest 18 Apr 2004 00:19:21 -0000 Issue 2213
Topics (messages 23475 through 23481):
Problem with vowels usinc accent mark
23475 by: hch
Re: Problems with mail on Windows
23476 by: Jordi Canals
23477 by: Luis Ferro
23480 by: Jordi Canals
23481 by: Jordi Canals
Re: PHP Site unix to Windows Migration errors
23478 by: Luis Ferro
Re: PHP5RC1 and fasctcgi from Shane Caraveo
23479 by: Thierry Bothorel
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi everybody, i have a small problem and i hope anybody can point me in the
right direction... I have some info that i retrieve from a mysql db. The
info in these fields is entered by my customer, and most of the times he is
using uppercase.
When i show the info on my browser i apply ucfirst(strtolower($string)) and
everything shows ok. I develop on a Windows XP + Apache 2 + PHP 4.3.4 as a
module. But when I upload the site to a production server, strings are ok
except that vowels with accent mark are written in uppercase. e.g.
"Producto para instalaciÓn sin cables". Production server uses linux +
apache (don't know which version) + PHP 4.1.2.
I tried to include a setlocale(LC_ALL,"es_ES") on my code, but nothing
happened...
Any help will come really handy!
--- End Message ---
--- Begin Message ---
Sorry, I forgot ... The SMTP server is running on Linux with Exim 4.24.
Is all data I have about the SMTP server because I do not administer it ...
Svensson, B.A.T. (HKG) wrote:
I have no idae, but M$ invented thier own SMTP, or tried
at least, would it work if you write the string like:
'Jordi Canals [SMTP:[EMAIL PROTECTED]'
-----Original Message-----
From: Jordi Canals
To: PHP-Windows List
Sent: 2004-04-17 01:49
Subject: [PHP-WIN] Problems with mail on Windows
Hi all,
I'm having some trouble using mail() on Windows. This is working for me
on some LINUX servers with no problems (sendmail, qmail and exim), but
cannot make it to work on windows.
I'd like to send a message with name and address on the TO field, not
just the address. To get that, I tried that formats:
$to = 'SomeOne Name <[EMAIL PROTECTED]>'
$to = '"SomeOne Name" <[EMAIL PROTECTED]>'
And then I tried to send the message with:
mail($to, $subject, $text);
The received error is:
Warning: mail(): SMTP server response: 501 <SomeOne Name
<[EMAIL PROTECTED]>>: "@" or "." expected after "SomeOne" in
mail.class.php on line 333
Note that the mail() function puts the To field inside <>, and that
makes the SMTP error. If I write just the email address, there is NO
problem for sending (even if there are more than one recipient):
mail('[EMAIL PROTECTED]', $subject, $text); // WORKS
Same with additionals headers CC or BCC with that format: "name"
<address>.
As I said, I have it working on Linux with no problems. This problem
only apears on a Windows Server I'm testing. I'm using an SMTP server on
other computer because this Windows does not have it installed and
cannot have it.
My server info:
Windows XP HE
Apache 2.0.49 (Win32)
PHP 4.3.6 (Tested also with 4.3.4)
My PHP.INI:
SMTP = smtp.example.com
[EMAIL PROTECTED]
Any help to solve this issue will be welcome ... I've been searching on
lists and manuals with no success. Hope not have to write my own SMTP
function ...
Regards,
Jordi.
--- End Message ---
--- Begin Message ---
My PHP.INI:
SMTP = smtp.example.com
[EMAIL PROTECTED]
You have to chance the php.ini configuration to point out to the smtp
server and use as sender one valid account there.
The current configurations you have in php.ini are the example ones and
need to be changed... (either directly or by the use of set_ini()
function...).
Cheers,
Luis Ferro
Teladigital.pt
--- End Message ---
--- Begin Message ---
Luis Ferro wrote:
My PHP.INI:
SMTP = smtp.example.com
[EMAIL PROTECTED]
You have to chance the php.ini configuration to point out to the smtp
server and use as sender one valid account there.
The current configurations you have in php.ini are the example ones and
need to be changed... (either directly or by the use of set_ini()
function...).
Luis, this is not an error. PHP.INI is well set, and the adresses I
wrote here were changed for example purposes.
The main problem is when sending mail from Windows with the mail()
function and using and SMTP server. The mail function modifies the TO
header (CC and BCC also). The change made by the mail function does not
conform with the RFC 2822 (wich obsoletes 822), and then the SMTP server
does not accept the mail because headers are incorrectly formed.
Here the examples: (Note that all examples work perfect on Linux, only
fails on windows)
mail("[EMAIL PROTECTED]", $subject, $text); // WORKS
mail("My Name <[EMAIL PROTECTED]>", $sub, $txt); // FAILS
Also, the function fails when you write additional headers with the Cc:
and Bcc: Fiels in the same format:
$header = "Cc: Someone Name <[EMAIL PROTECTED]";
$header .= "Bcc: Someother Name <[EMAIL PROTECTED]";
mail("[EMAIL PROTECTED]", $sub, $txt, $header); // FAILS
All this headers follow the RFC 2822, and the SMPT server would accept
them with no problems. (And it really does). The problem is that the PHP
mail layer on windows changes this headers encolsing them betwen the
signs <>.
Looking at the SMTP dialog, you can see that the mail() function
encloses all adresses betwen <>, and then the address are:
To: <[EMAIL PROTECTED]>
To: <My Name <[EMAIL PROTECTED]>>
Cc: <Someone Name <[EMAIL PROTECTED]>>
Bcc: <Someothe Name <[EMAIL PROTECTED]>>
What's the problem? Main problem is when the function starts sending
mail, because it modifies the additional headers. Modifiying the To:,
Cc: and Bcc: fields ... and then using the modified addresses in the
RCPT TO comand to send the mail.
The SMTP standard, stated on RFC 2821, expects only the email address on
the RCPT TO: command. This command MUST be formed this way:
RCPT TO:<[EMAIL PROTECTED]>
But PHP sends all the To: field in the form:
RCPT TO:<Someone Name <[EMAIL PROTECTED]>>
wich does not conform the standard.
Then, the same SMTP standard, expects all headers (Without any
modification) to be sent in the DATA section:
DATA
From: Jordi Canals <[EMAIL PROTECTED]>
To: Someone Name <[EMAIL PROTECTED]>
... so, in my opinion, the mail layer should extract the e-mail
adrresses to send the RCPT commands, and leave the headers with no
changes to send them in the SMTP DATA section.
Regards,
Jordi.
--- End Message ---
--- Begin Message ---
Jordi Canals wrote:
> The main problem is when sending mail from Windows with the mail()
function and using and SMTP server. The mail function modifies the TO
header (CC and BCC also). The change made by the mail function does not
conform with the RFC 2822 (wich obsoletes 822), and then the SMTP server
does not accept the mail because headers are incorrectly formed.
Here the examples: (Note that all examples work perfect on Linux, only
fails on windows)
mail("[EMAIL PROTECTED]", $subject, $text); // WORKS
mail("My Name <[EMAIL PROTECTED]>", $sub, $txt); // FAILS
Also, the function fails when you write additional headers with the Cc:
and Bcc: Fiels in the same format:
$header = "Cc: Someone Name <[EMAIL PROTECTED]";
$header .= "Bcc: Someother Name <[EMAIL PROTECTED]";
mail("[EMAIL PROTECTED]", $sub, $txt, $header); // FAILS
All this headers follow the RFC 2822, and the SMPT server would accept
them with no problems. (And it really does). The problem is that the PHP
mail layer on windows changes this headers encolsing them betwen the
signs <>.
Looking at the SMTP dialog, you can see that the mail() function
encloses all adresses betwen <>, and then the address are:
To: <[EMAIL PROTECTED]>
To: <My Name <[EMAIL PROTECTED]>>
Cc: <Someone Name <[EMAIL PROTECTED]>>
Bcc: <Someothe Name <[EMAIL PROTECTED]>>
What's the problem? Main problem is when the function starts sending
mail, because it modifies the additional headers. Modifiying the To:,
Cc: and Bcc: fields ... and then using the modified addresses in the
RCPT TO comand to send the mail.
The SMTP standard, stated on RFC 2821, expects only the email address on
the RCPT TO: command. This command MUST be formed this way:
RCPT TO:<[EMAIL PROTECTED]>
But PHP sends all the To: field in the form:
RCPT TO:<Someone Name <[EMAIL PROTECTED]>>
wich does not conform the standard.
Then, the same SMTP standard, expects all headers (Without any
modification) to be sent in the DATA section:
DATA
From: Jordi Canals <[EMAIL PROTECTED]>
To: Someone Name <[EMAIL PROTECTED]>
... so, in my opinion, the mail layer should extract the e-mail
adrresses to send the RCPT commands, and leave the headers with no
changes to send them in the SMTP DATA section.
Ok,
I've submited a bug and the answer was: Sending recipient headers with
this format is NOT suported on Windows.
So, in windows, you can use only email addresses on the recipient
headers. Sending mail with repicients in the form stated above is only
implemented on Linux and Unix Platforms.
More info about this at: http://bugs.php.net/bug.php?id=28038
Thanks to all for your time.
Regards,
Jordi.
--- End Message ---
--- Begin Message ---
From Unix to Windows there are lots of things that change, mainly the
defined environment vars (a test with phpinfo() in both servers could
help out check the diferences) - this may be the reason of some of those
path errors...
Other diferences are the pathing/disk access (be very carefull of
constructed paths with support of the environment/server vars) and the
fact that some things work very diferently (mainly email layer that
provides mail() function)...
In my experience there aren't much diferences between unix/windows
development apart from those items...
Cheers,
Luis Ferro
Teladigital.pt
--- End Message ---
--- Begin Message ---
No,
I gave up, as Shane said me he even have not the time to test with PHP5.
--
Thierry Bothorel
"Marco Montesines" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hi,
>
> Is your problem solved?
>
>
> "Thierry B." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > did someone succeeded to run fastcgi for IIS from Shane Caraveo (
> > isapi_fcgi.dll ) with PHP5. I get the message "Server Error, unable to
> > connect to fastcgi server."
> >
> >
> > Thierry B.
> > --
> > Click below to answer / cliquez ci dessous pour me repondre
> > http://cerbermail.com/?MQkxTL4vUP
--- End Message ---