Re: specifying smtp server on win32 via 5th mail() parameter

From: Date: Mon, 29 Apr 2002 03:29:49 +0000
Subject: Re: specifying smtp server on win32 via 5th mail() parameter
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-83469@lists.php.net to get a copy of this message
Jim Winstead wrote:
as suggested at http://bugs.php.net/10629, the patch below would allow win32 users to specify the smtp server to use as the 5th parameter to the mail() function. (the 'pass random options to my sendmail program' parameter on unix systems.) any thoughts? (maybe it's better to just use ini_set()?)
It sounds like better to use ini_set() if someone really needs it. Generally, it's not a good idea to have different API depends on platform. mail() is better to have the same API between Win & UNIX. IMO PS: Someone care to rewrite SMTP code for windows? It needs to be rewritten. -- Yasuo Ohgaki
jim Index: ext/standard/mail.c =================================================================== RCS file: /repository/php4/ext/standard/mail.c,v retrieving revision 1.51 diff -u -r1.51 mail.c --- ext/standard/mail.c 16 Mar 2002 15:50:20 -0000 1.51 +++ ext/standard/mail.c 28 Apr 2002 23:27:56 -0000 @@ -121,7 +121,7 @@ if (!sendmail_path) { #ifdef PHP_WIN32 /* handle old style win smtp sending */ - if (TSendMail(INI_STR("SMTP"), &tsm_err, headers, subject, to, message) != SUCCESS){ + if (TSendMail(extra_cmd ? extra_cmd : INI_STR("SMTP"), &tsm_err, headers, subject, to, message) != SUCCESS){ php_error(E_WARNING, "%s() %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err)); return 0; }


« previous php.dev (#83469) next »