Re: Update to mail() function help
| From: | Patrick Gibson | Date: | Mon, 26 May 2003 00:20:22 +0000 |
| Subject: | Re: Update to mail() function help | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-2003@lists.php.net to get a copy of this message | ||
That did the trick. Thanks for your help.
Attached is a diff if anyone cares to include a header in all emails sent
using the mail() function that contains the $_SERVER['SERVER_NAME']. Useful
for hosting companies...
Patrick
On 5/25/03 13:43, nicos@php.net wrote:
> Okay after few searches, yes I'm a noob also, you need :
>
> zval **server_name; and not zval *server_name;
>
> You need to use:
>
> convert_to_string_ex(server_name);
>
> fprintf(sendmail, "X-Site-Origin: %s\n", Z_STRVAL_PP(server_name));
>
> Try this please.
---
patrick gibson
patrick @ patrickg.com
http://patrickgibson.com/
--- mail.c Sun May 25 17:08:11 2003 +++ ext/standard/mail.c Fri Nov 29 03:15:43 2002 @@ -149,8 +149,7 @@ int ret; char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; - zval **server_name; - + if (!sendmail_path) { #if (defined PHP_WIN32 || defined NETWARE) /* handle old style win smtp sending */ @@ -199,16 +198,6 @@ #endif fprintf(sendmail, "To: %s\n", to); fprintf(sendmail, "Subject: %s\n", subject); - - zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name); - - convert_to_string_ex(server_name); - - if (strlen(Z_STRVAL_PP(server_name)) > 0) - { - fprintf(sendmail, "X-Site-Origin: %s\n", Z_STRVAL_PP(server_name)); - } - if (headers != NULL) { fprintf(sendmail, "%s\n", headers); }
--- mail.c Sun May 25 17:08:11 2003 +++ ext/standard/mail.c Fri Nov 29 03:15:43 2002 @@ -149,8 +149,7 @@ int ret; char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; - zval **server_name; - + if (!sendmail_path) { #if (defined PHP_WIN32 || defined NETWARE) /* handle old style win smtp sending */ @@ -199,16 +198,6 @@ #endif fprintf(sendmail, "To: %s\n", to); fprintf(sendmail, "Subject: %s\n", subject); - - zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name); - - convert_to_string_ex(server_name); - - if (strlen(Z_STRVAL_PP(server_name)) > 0) - { - fprintf(sendmail, "X-Site-Origin: %s\n", Z_STRVAL_PP(server_name)); - } - if (headers != NULL) { fprintf(sendmail, "%s\n", headers); }