Solving email address programmatically

Jean Louis <[email protected]> Wed, 02 Jun 2021 09:12:25 +0300
Newsgroups gmane.comp.gnu.mailutils.bugs
Message-ID <[email protected]>
I am trying to make an Emacs Lisp function that will safely call
`mail' program, but I see that there are some border cases that has to
be solved.

For example, some names can have comma and that often disturbs sending
email, it can fail. My problem is with quoting, but if I use
Emacs Lisp `call-process' quoting should be solved.

How should comma in the name get formatted?

I am using something like:

(format "\"\\\"%s\\\" <%s>\"" (rcd-rfc2047-encode to-name) to-email)


Jean