]> granicus.if.org Git - php/commitdiff
- Finish implementation of custom smtp port (introduces "smtp_port" ini config).
authorMarkus Fischer <mfischer@php.net>
Sun, 2 Jun 2002 17:13:48 +0000 (17:13 +0000)
committerMarkus Fischer <mfischer@php.net>
Sun, 2 Jun 2002 17:13:48 +0000 (17:13 +0000)
main/main.c
win32/sendmail.c

index 88941215effabbed077c022a39dd6bbae234028a..5dd53b4c258b739f72be32456b4aeec0135b4d38 100644 (file)
@@ -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
index 9234b9d231c9a94d85db651aa01e60bc68accfd6..052ecc0ff0e03f86e74173df2349cca824a7f63d 100644 (file)
@@ -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;
        }