Re: Update to mail() function help

From: Date: Sun, 25 May 2003 19:22:58 +0000
Subject: Re: Update to mail() function help
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-1993@lists.php.net to get a copy of this message
"Patrick Gibson" <php.dev@patrickg.com> a écrit dans le message news: BAF555C5.C868%php.dev@patrickg.com... > Hi Rasmus, I'm having a (likely) small problem here. I just preface this > problem with the fact that I do not have a lot of C experience (which is the > cause of my problem) -- most of my experiences are in Java, PHP and the > like. > > I have added the following into php_mail() in mail.c: > > zval *server_name; > > <snip, snip...> > > fprintf(sendmail, "To: %s\n", to); > fprintf(sendmail, "Subject: %s\n", subject); Hey, fprintf is not strcat. You're just overwriting sendmail with all these fprints. Use strcat. > > zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, > "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name); > > if (server_name != NULL) > { > fprintf(sendmail, "X-Site-Origin: %s\n", server_name); You prolly need a convert_to_string_ex(server_name) before using it in the

« previous php.internals (#1993) next »