# php.net announcement

- Thread: https://externals.io/message/12202
- Original archive: https://news-web.php.net/php.internals/12202
- Started by Sterling Hughes on 2004-08-17T23:19:56+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12202 — Sterling Hughes — 2004-08-17T23:19:56+00:00

URL: https://externals.io/message/12202#12202

http://www.php.net/:

 Hereby we would like to kindly ask everyone who published an article
or howto  about installing PHP on Windows to revise those instructions
according to our  latest guide. These new instructions got distributed
with PHP 5.0.1 in  both the source code and binary versions, and will
continue to be shipped  with future versions of PHP.

Uhm, Its nice that there are new instructions and all, but should we
really be recommending this?  What's the reason for this announcement?

-Sterling

---

## #12210 — Sean Coates — 2004-08-18T04:33:47+00:00

URL: https://externals.io/message/12202#12210 · In reply to: #12202

This news posting also says "more easier", and should not. I don't have 
the necessary karma to correct this.

S

Sterling Hughes wrote:
> http://www.php.net/:
> 
>  Hereby we would like to kindly ask everyone who published an article
> or howto  about installing PHP on Windows to revise those instructions
> according to our  latest guide. These new instructions got distributed
> with PHP 5.0.1 in  both the source code and binary versions, and will
> continue to be shipped  with future versions of PHP.
> 
> Uhm, Its nice that there are new instructions and all, but should we
> really be recommending this?  What's the reason for this announcement?
> 
> -Sterling

---

## #12217 — Zeev Suraski — 2004-08-18T12:26:24+00:00

URL: https://externals.io/message/12202#12217 · In reply to: #12202

It's fixed, and I also removed this 'call for change' paragraph.  It's 
unreasonable to ask everyone who ever published an article or a HOWTO to 
update their stuff, any more than it makes sense to ask everyone who ever 
wrote an XML article to update it for SimpleXML.  It has to happen naturally...

Zeev

At 07:33 18/08/2004, Sean Coates wrote:
>This news posting also says "more easier", and should not. I don't have 
>the necessary karma to correct this.
>
>S
>
>Sterling Hughes wrote:
> > […]

---

## #12229 — Gordon P. Hemsley — 2004-08-18T22:02:31+00:00

URL: https://externals.io/message/12202#12229 · In reply to: #12217

If I remember correctly, the reason that the "call for change" was
included was because the new installation instructions described a
different method of installation than the old installation
instructions.

The "call for change" was for everyone who had previously written an
article or tutorial on how to install PHP itself, so as to try to keep
installation methods the same; changing an article about XML for
SimpleXML is not the same thing.


> It's fixed, and I also removed this 'call for change' paragraph.  It's
> unreasonable to ask everyone who ever published an article or a HOWTO to
> update their stuff, any more than it makes sense to ask everyone who ever
> wrote an XML article to update it for SimpleXML.  It has to happen naturally...
> 
> Zeev
> 
> 
> 
> At 07:33 18/08/2004, Sean Coates wrote:
> > […]
> 
> --
> 
> 
> 
> 


-- 
Gordon P. Hemsley
gphemsley@gmail.com
http://www.lttp.net/ • http://cmsforme.sourceforge.net/

---

## #12230 — David Vance — 2004-08-18T22:14:27+00:00

URL: https://externals.io/message/12202#12230 · In reply to: #12217

sorry in advance for the length, formatting and possible redundancy of
this message.

Anyway, on Windows, leaving "sendmail_from" blank and setting a "From:"
header in the extra headers parameter doesn't work.

test.php:
<?php
mail('example@php.com','subject','body',"From: me@example.com\r\n");
/*
Warning: `mail()`: "sendmail_from" not set in php.ini or custom "From:"
header missing in C:\dev\quiktests\test.php on line 3
*/

??--> http://bugs.php.net/bug.php?id=28976
there are also a couple user notes on the mail manual page to the effect
of "use `ini_set()`", but that seems messy, especially for distributed
scripts to do a check everytime they send `mail()`:
if(PHP_OS == 'Win' && empty(ini_get("sendmail_from")){
 ini_set("sendmail_from", $tempFromAddress);
}


I don't know C (or any cvs/patch tools), but here's what I think is going on:

in ext/standard/mail.c we find the following code (notice the last
argument to TSendMail() is NULL):

[code]
....
PHPAPI int php_mail(char *to, char *subject, char *message, char *headers,
char *extra_cmd TSRMLS_DC) {
.....
if (!sendmail_path) {
#if (defined PHP_WIN32 || defined NETWARE)
  /* handle old style win smtp sending */
  if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject,
to, message, NULL, NULL, NULL) == FAILURE) {
....
[/code]


unfortunately, in win32/sendmail.c we find this:

[code]
....
PHPAPI int TSendMail(char *host, int *error, char **error_message,
  char *headers, char *Subject, char *mailTo, char *data,
  char *mailCc, char *mailBcc, char *mailRPath)
{
....
/* Fall back to sendmail_from php.ini setting */
if (mailRPath && *mailRPath) {
  RPath = estrdup(mailRPath);
} else if (INI_STR("sendmail_from")) {
  RPath = estrdup(INI_STR("sendmail_from")); }
else {
  if (headers) {
    efree(headers);
    efree(headers_lc);
  }
  *error = W32_SM_SENDMAIL_FROM_NOT_SET; return FAILURE;
}
....
[/code]

it seems mailRPath will always be `NULL` and "sendmail_from" will always be
"fallen back" to, and thus you get an error.

maybe, probably, i'm missing something, but at the very least, the error
message ("custom "From:" header missing") or the documentation could be
altered.

thanks.
