mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
- Adjust for improved error messages from win32/sendmail.c
This commit is contained in:
parent
7a0866ff90
commit
9b86cff931
@ -112,6 +112,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
|
||||
{
|
||||
#ifdef PHP_WIN32
|
||||
int tsm_err;
|
||||
char *tsm_errmsg = NULL;
|
||||
#endif
|
||||
FILE *sendmail;
|
||||
int ret;
|
||||
@ -121,8 +122,13 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
|
||||
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));
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user