There are some choices to make before starting the implementation.
Emails will need to be sent by an SMTP server. You cannot communicate with an SMTP server with a library in the frontend because that would require exposing your SMTP credentials to the world.
This means you have two options: send the email through SMTP yourself server-side, or use an external service to submit the form.
If using an external service, it might be as simple as POSTing the data to a third-party API. I believe there are many hosted services to handle POST submissions and do something with the data.
If sending through SMTP yourself, you'll need to write a server-side script and send the data from the frontend to the backend.
In both situations, you won't need any additional libraries client-side. You can just use the app.request method to submit the data to an API.
You could implement a backend with javascript, but the easiest is probably to make the backend as part of the Flarum extension as well, so that would be PHP.
Using the Flarum PHP API, you can create a custom API route, connected to a custom controller, and in that controller you can use the existing Mailer instance that Flarum will automatically create with the email credentials configured in the backend.
You'll likely also need some validation on the user arguments, and maybe some flood/spam control.
The Mailing extension does basically that https://github.com/clarkwinkelmann/flarum-ext-mailing with some additional logic to select recipients, and it uses a Job to take advantage of the asynchronous queues in Flarum. The relevant parts are the API route definition in https://github.com/clarkwinkelmann/flarum-ext-mailing/blob/master/extend.php#L16 , the controller in https://github.com/clarkwinkelmann/flarum-ext-mailing/blob/master/src/Controllers/SendAdminEmailController.php and the actual mail sending in https://github.com/clarkwinkelmann/flarum-ext-mailing/blob/master/src/Jobs/SendMail.php
The Mailer object used by Flarum comes from Laravel, so the Laravel documentation can help with that. However the router and controllers are not the same as Laravel, but the concepts are mostly the same. Making requests and routes and controllers is covered by our documentation.