The best description of starting position would be this Sending Emails With PHP & jQuery text.
TL;DR I am calling a php script with jQuery.post(). Php has something like this inside
$to = $_REQUEST['to'];
$from = $_REQUEST['from'];
$message = $_REQUEST['content'];
$subject = $_REQUEST['subject'];
$header = "From: <".$from.">" ."\r\n";
mail($to, $subject, $message, $header);
And the question is how can I protect my mail script from abuse by creating a js cycle and calling it a million times? Or just from calling it with post?
In order to avoid automated form submission normally web developers use
CAPTCHA. You should also use image basedCAPTCHAto make your form secure.