]> granicus.if.org Git - php/commitdiff
make it possible to set the CHARSET parameter with imap_mail_compose()
authorChuck Hagenbuch <chagenbu@php.net>
Thu, 24 May 2001 03:06:10 +0000 (03:06 +0000)
committerChuck Hagenbuch <chagenbu@php.net>
Thu, 24 May 2001 03:06:10 +0000 (03:06 +0000)
(Johan Ekenberg <johan@ekenberg.se>)

ext/imap/php_imap.c

index 544a591db5b30008a14e7d2203cd7f485da10697..5dec6850c9781e803299cea2ab9c6767002155fb 100644 (file)
@@ -3266,6 +3266,14 @@ PHP_FUNCTION(imap_mail_compose)
                        convert_to_long_ex(pvalue);
                        bod->encoding = (short) Z_LVAL_PP(pvalue);
                }
+               if (zend_hash_find(Z_ARRVAL_PP(data), "charset", sizeof("charset"), (void **) &pvalue)== SUCCESS) {
+                       convert_to_string_ex(pvalue);
+                       tmp_param = mail_newbody_parameter();
+                       tmp_param->value = cpystr(Z_STRVAL_PP(pvalue));
+                       tmp_param->attribute = "CHARSET";
+                       tmp_param->next = bod->parameter;
+                       bod->parameter = tmp_param;
+               }
                if (zend_hash_find(Z_ARRVAL_PP(data), "subtype", sizeof("subtype"), (void **) &pvalue)== SUCCESS) {
                        convert_to_string_ex(pvalue);
                        bod->subtype = cpystr(Z_STRVAL_PP(pvalue));
@@ -3344,6 +3352,14 @@ PHP_FUNCTION(imap_mail_compose)
                                convert_to_long_ex(pvalue);
                                bod->encoding = (short) Z_LVAL_PP(pvalue);
                        }
+                       if (zend_hash_find(Z_ARRVAL_PP(data), "charset", sizeof("charset"), (void **) &pvalue)== SUCCESS) {
+                               convert_to_string_ex(pvalue);
+                               tmp_param = mail_newbody_parameter();
+                               tmp_param->value = cpystr(Z_STRVAL_PP(pvalue));
+                               tmp_param->attribute = "CHARSET";
+                               tmp_param->next = bod->parameter;
+                               bod->parameter = tmp_param;
+                       }
                        if (zend_hash_find(Z_ARRVAL_PP(data), "subtype", sizeof("subtype"), (void **) &pvalue)== SUCCESS) {
                                convert_to_string_ex(pvalue);
                                bod->subtype = cpystr(Z_STRVAL_PP(pvalue));