You cannot run javascript function in the ajax file .. instead run the desired php code in ajaxfile
<?php
add_action('wp_ajax_sendmail', 'sendmail');
add_action('wp_ajax_nopriv_sendmail', 'sendmail');
function sendmail() {
echo 'alert_me';
die;
}
?>
Then is the response you can perform the alerting functionality
submitHandler: function(form) {
$('#loading_icon').show();
$('#click').hide();
var params = $(form).serialize();
$.ajax ({
type: 'POST',
url: ajaxurl,
data: params + '&action=sendmail',
success: function(response) {
$('#response').hide();
$('#response').html(response);
$('#response').fadeIn('slow');
$('#loading_icon').hide();
if(reponse == 'alert_me'){
alert('Alert your required string');
}
}
});
}