Guest User

Untitled

a guest
Nov 6th, 2017
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. MAIL_DRIVER=mail
  2. MAIL_HOST=smtp.gmail.com
  3. MAIL_PORT=587
  4. MAIL_USERNAME=parqueosumg@gmail.com
  5. MAIL_PASSWORD=********
  6. MAIL_ENCRYPTION=ssl
  7.  
  8. <?php
  9.  
  10. namespace AppHttpControllers;
  11.  
  12. use IlluminateHttpRequest;
  13. use AppParqueos;
  14. use AppMailComentariosParqueos;
  15. use Mail;
  16. class ParqueosController extends Controller
  17. {
  18. public $message = "";
  19. public $result = false;
  20. public $records = array();
  21.  
  22.  
  23.  
  24. public function EnviarComentario()
  25. {
  26. try
  27. {
  28. $data = [];
  29.  
  30. Mail::send('mails.ComentariosParqueos', $data, function ($message){
  31. $message->subject('Comentario');
  32. $message->to('parqueosumg@gmail.com');
  33. });
  34.  
  35. $statusCode = 200;
  36. $this->message = "Correo enviado correctamente";
  37. $this->result = true;
  38. }
  39. catch (Exception $e)
  40. {
  41. $statusCode = 200;
  42. $this->message = $e->getMessage();
  43. }
  44. finally
  45. {
  46. $response =
  47. [
  48. 'message' => $this->message,
  49. 'result' => $this->result,
  50. 'records' => $this->records
  51. ];
  52. return response()->json($response, $statusCode);
  53. }
  54. }
  55. }
  56.  
  57. {
  58. "message": "Correo enviado correctamente",
  59. "result": true,
  60. "records": Array[0][
  61.  
  62. ]
  63. }
Add Comment
Please, Sign In to add comment