cvs: php4 /ext/standard mail.c

From: Date: Tue, 14 May 2002 20:43:48 +0000
Subject: cvs: php4 /ext/standard mail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11919@lists.php.net to get a copy of this message
mfischer Tue May 14 16:43:48 2002 EDT Modified files: /php4/ext/standard mail.c Log: - Adjust for improved error messages from win32/sendmail.c Index: php4/ext/standard/mail.c diff -u php4/ext/standard/mail.c:1.51 php4/ext/standard/mail.c:1.52 --- php4/ext/standard/mail.c:1.51 Sat Mar 16 10:50:20 2002 +++ php4/ext/standard/mail.c Tue May 14 16:43:48 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mail.c,v 1.51 2002/03/16 15:50:20 mfischer Exp $ */ +/* $Id: mail.c,v 1.52 2002/05/14 20:43:48 mfischer Exp $ */ #include <stdlib.h> #include <ctype.h> @@ -111,7 +111,8 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC) { #ifdef PHP_WIN32 - int tsm_err; + int tsm_err; + char *tsm_errmsg = NULL; #endif FILE *sendmail; int ret; @@ -121,9 +122,14 @@ if (!sendmail_path) { #ifdef PHP_WIN32 /* handle old style win smtp sending */ - if (TSendMail(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; + if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message) == FAILURE) { + if (tsm_errmsg) { + php_error(E_WARNING, "%s() %s", get_active_function_name(TSRMLS_C), tsm_errmsg); + efree(tsm_errmsg); + } else { + php_error(E_WARNING, "%s() %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err)); + } + return 0; } return 1; #else

« previous php.cvs (#11919) next »