I have a AngularJS Webapplication with Java Backend.
Now i want to send a mail out of the Angular Application. I thought the best way is to send a post or get request to the webservice and send the Mail via an internal smtp server to the recipient.
But i think there is a big security problem with this concept. When i create a webservice call like: /api/mail?mailto=john@doe.com
someone can take the link to the webservice, change the recipient and take this link to start spamming to other people.
Do someone know a secure way for this architecture to send a mail via a webservice? It is necessary that i have to pass the recipient to the mail service, because the user set this in the AngularJS UI.
I am happy about any suggestion.