Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
1,156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. MAIL_DRIVER=smtp
  2. MAIL_HOST=smtp.gmail.com
  3. MAIL_PORT=587
  4. MAIL_USERNAME=username@gmail.com
  5. MAIL_PASSWORD=password
  6. MAIL_ENCRYPTION=ssl
  7.  
  8. <?php
  9.  
  10. return [
  11. 'driver' => env('MAIL_DRIVER', 'smtp'),
  12. 'host' => env('MAIL_HOST', 'smtp.gmail.org'),
  13. 'port' => env('MAIL_PORT', 587),
  14. 'from' => [
  15. 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
  16. 'name' => env('MAIL_FROM_NAME', 'Example'),
  17. ],
  18. 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
  19. 'username' => env('MAIL_USERNAME'),
  20. 'password' => env('MAIL_PASSWORD'),
  21. 'sendmail' => '/usr/sbin/sendmail -bs',
  22. 'markdown' => [
  23. 'theme' => 'default',
  24.  
  25. 'paths' => [
  26. resource_path('views/vendor/mail'),
  27. ],
  28. ],
  29.  
  30. ];
  31.  
  32. public function postContact(Request $request) {
  33. $this->validate($request, [
  34.  
  35. 'email' => 'required|email',
  36. 'subject' => 'required|min:3',
  37. 'message' => 'required|min:10'
  38. ]);
  39.  
  40. $data = array(
  41. 'email' => $request->email,
  42. 'subject' => $request->subject,
  43. 'mailbody' => $request->message
  44. );
  45.  
  46. Mail::send('emails.contact', $data, function($message) use ($data) {
  47. $message->from($data['email']);
  48. $message->to('username@gmail.com');
  49. $message->subject($data['subject']);
  50. });
  51. }
  52.  
  53. MAIL_DRIVER=smtp
  54. MAIL_HOST=smtp.gmail.com
  55. MAIL_PORT=587
  56. MAIL_USERNAME=username@gmail.com
  57. MAIL_PASSWORD=mypassword
  58.  
  59. MAIL_DRIVER=smtp
  60. MAIL_HOST=smtp.gmail.com
  61. MAIL_PORT=465
  62. MAIL_USERNAME=address@gmail.com
  63. MAIL_PASSWORD=secreat
  64. MAIL_ENCRYPTION=ssl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement