dimanche 2 juin 2019

Process could not be started [The system cannot find the path specified. ] while using Mail Functionality of Laravel

While using the smtp or mailgun MAIL_DRIVER for Laravel i get the error : Process could not be started [The system cannot find the path specified. ] I am unable to figure it out the issue so far.

I tried to make sure that all the configuration etc.. are correct and tested it on a different laravel installation aswell and having same issue on that one aswell.

My .env config for smtp i tested :

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME={removed for security}
MAIL_PASSWORD={removed for security}
MAIL_FROM_ADDRESS=from@example.com
MAIL_FROM_NAME=Example

My .env config for mailgun i tested :

MAIL_DRIVER=mailgun
MAILGUN_DOMAIN={removed for security}
MAILGUN_SECRET={removed for security}
MAILGUN_ENDPOINT={removed for security}
MAIL_FROM_ADDRESS=from@example.com
MAIL_FROM_NAME=Example

My Code which is used for sending the mail through route :

use Illuminate\Support\Facades\Mail;

Route::get('/',function(){
    $data = [
        'title' => 'Hi Example, How are You?',
        'content' => 'Testing out the mail system'
    ];

    Mail::send('emails.test',$data, function($message){
        $message->to('example@gmail.com','Example')->subject('Hello Example, Whats Up');
    });
});


My View File for the mail:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <h1></h1>
    <p></p>
</body>
</html>

The expected result is that it should have sent the message in case of smtp or mailgun, however it is throwing an error:

Swift_TransportException
Process could not be started [The system cannot find the path specified. ]



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2WcbaTf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire