How do I send an email from a custom controller endpoint?

How do I send an email from a custom controller endpoint?

With the command go to http://localhost:8050/components_data/sendtopicarea/1721

1721 is the value that will be received in the controller.

When run from the href the url always points to http://localhost:8050/error/forbidden

Please help…