From: Markus Fischer Date: Sun, 2 Jun 2002 17:13:48 +0000 (+0000) Subject: - Finish implementation of custom smtp port (introduces "smtp_port" ini config). X-Git-Tag: RELEASE_0_90~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b04656ad407268ca1223c40044f718fb94059c7b;p=php - Finish implementation of custom smtp port (introduces "smtp_port" ini config). --- diff --git a/main/main.c b/main/main.c index 88941215ef..5dd53b4c25 100644 --- a/main/main.c +++ b/main/main.c @@ -288,6 +288,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("error_prepend_string", NULL, PHP_INI_ALL, OnUpdateStringUnempty, error_prepend_string, php_core_globals, core_globals) PHP_INI_ENTRY("SMTP", "localhost",PHP_INI_ALL, NULL) + PHP_INI_ENTRY("smtp_port", "25", PHP_INI_ALL, NULL) PHP_INI_ENTRY("browscap", NULL, PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY("error_reporting", NULL, PHP_INI_ALL, OnUpdateErrorReporting) #if MEMORY_LIMIT diff --git a/win32/sendmail.c b/win32/sendmail.c index 9234b9d231..052ecc0ff0 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -198,7 +198,10 @@ int TSendMail(char *host, int *error, char **error_message, if (NULL == (*error_message = ecalloc(1, HOST_NAME_LEN + 128))) { return FAILURE; } - snprintf(*error_message, HOST_NAME_LEN + 128, "Failed to connect to mailserver at \"%s\", verify your \"SMTP\" setting in php.ini", MailHost); + snprintf(*error_message, HOST_NAME_LEN + 128, + "Failed to connect to mailserver at \"%s\" port %d, verify your \"SMTP\"" + "and \"smtp_port\" setting in php.ini or use ini_set()", + MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port")); return FAILURE; } else { ret = SendText(RPath, Subject, mailTo, data, headers, headers_lc, error_message); @@ -609,7 +612,7 @@ int MailConnect() } */ - portnum = (short) INI_INT("sendmail_port"); + portnum = (short) INI_INT("smtp_port"); if (!portnum) { portnum = 25; }