我创建了一个用于发送邮件的演示。 我正在联系页面发送邮件它正在工作。 但是当我为TO使用动态电子邮件时,它就无法正常工作。
Mail::send('emails.otp_mail_format',['otp'=>'123456'],
function($message){
$message->from('no-reply@example.com');
$message->**to($uEmailAddress)**->subject('AccountVerification');
});
但是在代码下工作
Mail::send('emails.otp_mail_format',['otp'=>'123456'],
function($message){
$message->from('no-reply@example.com');
$message->**to('kanu@example.com')**->subject('AccountVerification');
});
到(' example@gmail.com')正在运作
但是到($ uEmailAddress)然后它无效
答案 0 :(得分:0)
Mail :: send('emails.otp_mail_format',['otp'=> $ user_otp], function($ message)使用($ uEmailAddress) { $ message-> to($ uEmailAddress) - > from('no-reply@exaple.com','App Name') - > subject('MyApp :: Account Verification'); });