Merhaba;
mail gönderirken mail adresi yerine değişken tanımladığımda hata alıyorum.
$dene yerine mail adresi yazınca çalışıyor.
foreach ($us as $ab)
{
$dene=$ab->email;
$data = ['ad' => $input['ad'], 'eposta' => $input['eposta'],'telefon' => $input['telefon'],'tarih' => $input['tarih']];
Mail::send('emails.gunaydin', $data, function($message) use($data)
{
$message->to("$dene", $data['ad'])
->subject('Randevu Talebi - e.com')
->replyTo('a@gmail.com', 'deneme');
});
}
hata
Whoops, looks like something went wrong.
1/1
ErrorException in RandevuTalep.php line 81:
Undefined variable: dene
in RandevuTalep.php line 81
at HandleExceptions->handleError('8', 'Undefined variable: dene', 'C:\xampp\htdocs\mezcrm\app\Http\Controllers\RandevuTalep.php', '81', array('message' => object(Message), 'data' => array('ad' => '', 'eposta' => '', 'telefon' => '', 'tarih' => ''))) in RandevuTalep.php line 81
at RandevuTalep->App\Http\Controllers\{closure}(object(Message))
at call_user_func(object(Closure), object(Message)) in Mailer.php line 403
at Mailer->callMessageBuilder(object(Closure), object(Message)) in Mailer.php line 163
at Mailer->send('emails.gunaydin', array('ad' => '', 'eposta' => '', 'telefon' => '', 'tarih' => ''), object(Closure)) in Facade.php line 221
at Facade::__callStatic('send', array('emails.gunaydin', array('ad' => '', 'eposta' => '', 'telefon' => '', 'tarih' => ''), object(Closure))) in RandevuTalep.php line 84
at Mail::send('emails.gunaydin', array('ad' => '', 'eposta' => '', 'telefon' => '', 'tarih' => ''), object(Closure)) in RandevuTalep.php line 84
at RandevuTalep->index4(object(Request))
at call_user_func_array(array(object(RandevuTalep), 'index4'), array(object(Request))) in Controller.php line 80