Skip to content

Mbstring: implement mb_send_mail() VM builtin (#6548) - #18783

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-6548-mb-send-mail
Jul 14, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-6548-mb-send-mail

Conversation

@PurHur

@PurHur PurHur commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Implements mb_send_mail() in ext/mbstring/ toward php-src parity (#6548).

  • MbstringMailProfile — per-mb_language() mail charset/header/body encodings (php-src libmbfl/nls)
  • VmMbstring::prepareSendMail() — recipient normalization, RFC 2047 subject encoding, body charset conversion + transfer encoding, MIME header assembly
  • mb_send_mail.php — VM builtin registered in ext/mbstring/Module.php; delegates transport to compiler mail() (returns false when sendmail unavailable, matching mail_registered.phpt)
  • Compliance guards + unit test for MIME header preparation

php-src reference: ext/mbstring/mbstring.cPHP_FUNCTION(mb_send_mail)

PHP-in-PHP: no new C runtime; reuses encodeMimeheader(), convertEncoding(), and ext/standard/mail.php.

Verification

source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_mb_send_mail.php
# ok

vendor/bin/phpunit --filter 'MbSendMailTest|mb_send_mail'
# OK (7 tests, 11 assertions)

php script/bootstrap-inventory.php --check
# OK 4844/4844

Note: ./script/ci-fast.sh spine-sync still reports 14 pre-existing master drift files (sysvsem, convert_uu) unrelated to this diff.

Closes #6548

Made with Cursor

Register mb_send_mail in ext/mbstring with PHP-in-PHP MIME header/body
preparation (MbstringMailProfile + VmMbstring::prepareSendMail) and delegate
to the compiler mail() transport. php-src ref: ext/mbstring/mbstring.c.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ef5835f into master Jul 14, 2026
@PurHur
PurHur deleted the agent/issue-6548-mb-send-mail branch July 14, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant