Hi I'm still learning to be good in php programming, I has been find for the solution to my problem about a day but still can't solve it. The problem is stated below.
I'm using laravel framework for this project, I would like to send different emails to different recipients and my way to do it is using a page with loop a form like below enter image description here
<script>
//auto submit form
document.getElementById('sendemail').submit(); // SUBMIT FORM
</script>
@foreach ($users as $user)
<?php
$count_emps += count($user->id);
for($i=0; $i<=$count_emps; $i++){
}
?>
<form id = "sendemail" class = "form-horizontal" role = "form" method = "POST" action = "{{ url('/tms/sendemail/send') }}">
{!! csrf_field() !!}
<div class = "container">
<label for = "receiver">To: </label>
<input id = "count" type = "text" name = "count" value = "{{ $i }}" class = "form-control">
<input id = "receiver" type = "text" name = "receiver" value = "{{ $user->id }}" class = "form-control">
<input type = "submit" value = "Send">
</div>
</form>
@endforeach
The problem now is I'm out of the way to let each of the form run so that I get 3 different email from the form shown. Please help and thank you.