Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. 'driver' => 'smtp',
  2. 'host' => 'smtp.gmail.com',
  3. 'port' => 587,
  4. 'from' => array('address' => 'postmaster@test.com', 'name' => 'Postmaster'),
  5. 'encryption' => 'tls',
  6. 'username' => 'xxx@gmail.com',
  7. 'password' => 'xxx',
  8. 'sendmail' => '/usr/sbin/sendmail -bs',
  9. 'pretend' => false,
  10.  
  11. {{ Form::open(array('id'=>'mail-form', 'url'=>'en/mail', 'method' => 'post')) }}
  12. {{ Form::text('first_name', null , array('placeholder'=>Lang::get('quotation.first_name'), 'class'=>'text-input')) }}
  13. {{ Form::text('name', null , array('placeholder'=>Lang::get('quotation.name'), 'class'=>'text-input')) }}
  14. {{ Form::text('email', null , array('placeholder'=>Lang::get('quotation.email'), 'class'=>'text-input')) }}
  15. {{ Form::submit(Lang::get('quotation.send'), array('class'=>'submit-mail')) }}
  16. {{ Form::close() }}
  17.  
  18. public function postMail(){
  19. $input = Input::all();
  20.  
  21. $data = array(
  22. 'first_name' => $input['first_name'],
  23. 'name' => $input['name'],
  24. 'email' => $input['email'],
  25. );
  26.  
  27. Mail::send('_emails.quotation', $data, function($message){
  28. $message->to($input['email'], $input['name'].' '.$input['first_name'])->subject('Test');
  29. });
  30.  
  31. return Redirect::back();
  32. }
  33.  
  34. Mail::send('_emails.quotation', ['data' => $data], function ($m) use ($data){
  35. $message->to($data->email, $data->name.' '.$data->first_name)->subject('Test');
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement