As mentioned I’m fairly certain that won’t work. You’ll need to set up a function.
Also trying to send it client-side would expose the API to everyone that uses the site which would then allow anyone to use it to send email via your account.
See also