Skip to content

Stdlib: mb_send_mail() — multibyte MIME mail send missing (ext/mbstring/mbstring.c) #6548

Description

@PurHur

Category

stdlib · php-src-strict

Problem

mb_send_mail() is not registered. Zend exposes it from ext/mbstring for sending RFC-compliant mail with multibyte headers/bodies (pairs with mail() #3285 and MIME helpers #6038). Web apps and CLI scripts that call mb_send_mail() fail today.

php-src reference

Repro (failure today)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(function_exists(\"mb_send_mail\")); echo \"\\n\";"
'
# bool(false)

Compare Zend (ext/mbstring loaded):

./script/docker-exec.sh -- bash -lc 'php -r "var_export(function_exists(\"mb_send_mail\")); echo \"\\n\";"'
# bool(true)

Scope

Module Path
Extension ext/mbstring/mb_send_mail.php (new), wire in ext/mbstring/Module.php
VM Delegate to mail() once #3285 exists, or thin sendmail wrapper matching php-src header encoding
Encoding Reuse mb_internal_encoding() / MIME helpers from #4636 / #6038
Tests test/compliance/cases/stdlib/mb_send_mail.phpt (mock/skip when sendmail unavailable)

PHP-in-PHP first: PHP implementation in ext/mbstring/; avoid permanent C-only mail tables in runtime/*.c.

Done when

  • function_exists('mb_send_mail') true when mbstring module is loaded
  • Argument count / type errors match Zend (TypeError on non-string recipients/subject/body; enum-case operands rejected under php-src-strict)
  • Optional $additional_headers / $additional_params semantics match php-src for ASCII + UTF-8 subjects
  • Compliance test green or @group sendmail skipped with documented reason

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "var_export(function_exists(\"mb_send_mail\"));"'
./script/ci-fast.sh --filter mb_send_mail

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinearea:webWeb / CGI / superglobalsenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions