Advertisement
Guest User

Untitled

a guest
Oct 11th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. Route::any('contact_us/send', function() {
  2. return Mail::send('contactus.send', ['name' => 'Advaith'], function($message) {
  3. $name = $_POST['name'];
  4. $from = $_POST['email'];
  5. $message->to('itsme@gmail.com')->from($from, $name)->subject('Feed Back');
  6. //itsme@gmail.com is used in this question only
  7. });
  8. });
  9.  
  10. MAIL_DRIVER=smtp
  11. MAIL_HOST=smtp.gmail.com
  12. MAIL_PORT=587
  13. MAIL_USERNAME=itsme@gmail.com
  14. MAIL_PASSWORD=**********
  15. MAIL_ENCRYPTION=tls
  16.  
  17. 'driver' => env('MAIL_DRIVER', 'smtp'),
  18. 'host' => env('MAIL_HOST', 'smtp.gmail.com'),
  19. 'port' => env('MAIL_PORT', 587),
  20. 'from' => [
  21. 'address' => 'hello@example.com',
  22. 'name' => 'Example',
  23. ],
  24. 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
  25. 'username' => env('MAIL_USERNAME'),
  26. 'password' => env('MAIL_PASSWORD'),
  27. 'sendmail' => '/usr/sbin/sendmail -bs',
  28. 'pretend' => false,
  29.  
  30. <form class="ad-form col-md-12" method="POST" action="/contact_us/send">
  31. {{ csrf_field() }}
  32. <input placeholder="Name...*" type="text" name="name" required="required">
  33. <br>
  34. <input placeholder="Email...*" type="email" name="email" required="required">
  35. <br>
  36. <textarea required="required" placeholder="Your valuable feedback...*" name="comment" rows="5" cols="40"></textarea>
  37. <br>
  38. <input type="submit" name="submit" value="Send">
  39. </form>
  40.  
  41. <div style="border: 2px solid orange; padding: 30px;">
  42. <div>From: <b>{{ $_POST['name'] }}</b></div>
  43. <div>From-Email: <b>{{ $_POST['email'] }}</b><hr></div><br>
  44. <div style="text-align: justify;"><strong>{{ $_POST['comment'] }}</strong></div>
  45. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement