kuns25
9 months ago

Cant send mail in laravel 5.3

Posted 9 months ago by kuns25

Hii , Im trying to send mail in my laravel 5.3 project , but im not receiving any mail , neither im getting any error , also mail code when i use in laravel 5.7 im receiving mail on my mailtrap .

please guide me if there is any difference in laravel 5.3 & 5.7 mail.

code is quite simple , please help

My Route


Route::get('contacts','[email protected]');


My Controller

<?php

namespace App\Http\Controllers;

use App\Mail\mailtrap;
use Illuminate\Support\Facades\Mail;

  
class MailController extends Controller
{
    public function index(){
    
    Mail::to('[email protected]')->send(new mailtrap());
         
    }
}
 

my mailable

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class mailtrap extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('email');
    }
}

my view

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Mail Send</title>
</head>
<body>

    <h3>You Have Received Enquiry From Website</h3>
    
    


</body>
</html> 

Please sign in or create an account to participate in this conversation.