Click here to Skip to main content
14,694,505 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i am newbie of php laravel and i am trying to call the sp and send it to email.

What I have tried:

This is My Controller Page
public function mailsend()
$data=DB::statement('CALL SendMailABC(?,?,?)',
'1', //ID
'User 2', //User
'David' //Name
\Mail::to('')->send(new SendMail($data));
return 'A message has been sent to Mailtrap!';

My Mail Page
public function __construct($data)
public function build()
return $this -> from('', 'Test Mail')
-> subject('mail from mee')
-> view('mails.mailview')
'Login_ID'=>$this->prm_ID, //prm_ID is from sp field
'User'=>$this->prm_User, ''
'Name'=>$this->prm_Name, ''

it comes out with the "Undefined property: App\Mail\SendMail::$prm_LoginID " error whenever i try to execute
Richard MacCutchan 21-Jul-20 6:56am
I do not see any reference to prm_LoginID in the above code. Where does this error message appear? What does the stored procedure return?
BBO001 21-Jul-20 21:26pm
all the prm_ is my store procedure's IN parameter
Richard MacCutchan 22-Jul-20 3:33am
Well I can only assume that prm_LoginID is not being given any value in your stored (not store) procedure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900