Recipients are comma-joined into the path; everything else rides in the query string. Every
field is percent-encoded, because subjects and bodies routinely contain &, # and +, each
of which silently corrupts the parse if left raw.
Note that encoding INFLATES the text — every space becomes %20, every newline %0A — so a
body of roughly 1,000 characters already yields a ~1,450-character URL. Agents should be told a
body ceiling near 1,000, not one near MAILTO_MAX_URL_LENGTH.
Whether url is short enough for a mail client to open without truncating the body.
When false the caller must NOT open it — show the full draft another way.
Build a
mailto:URL from a compose-email command.Recipients are comma-joined into the path; everything else rides in the query string. Every field is percent-encoded, because subjects and bodies routinely contain
&,#and+, each of which silently corrupts the parse if left raw.Note that encoding INFLATES the text — every space becomes
%20, every newline%0A— so a body of roughly 1,000 characters already yields a ~1,450-character URL. Agents should be told a body ceiling near 1,000, not one near MAILTO_MAX_URL_LENGTH.