dimanche 3 février 2019

Email doesn't send from Laravel to Webmail

I can't send email from my Laravel live project to an webmail account.

I have configured all possible files to send email.

config/mail.php

'driver' => env('MAIL_DRIVER', 'smtp'), 
'host' => env('MAIL_HOST', 'webmail_host'),
'port' => env('MAIL_PORT', 465),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'webmail_username'),
'name' => env('MAIL_FROM_NAME', 'Test'),
],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'sendmail' => '/usr/sbin/sendmail -bs',

.env

MAIL_DRIVER=mail //also tried with 'sendmail' and 'mail'
MAIL_HOST=webmail_host
MAIL_PORT=587 //also tried with '645'
MAIL_USERNAME=webmail_username
MAIL_PASSWORD='webmail_password'
MAIL_ENCRYPTION=ssl //also tried with 'tls'

Another interesting part is there is no error shows in my 'storage/log' file. Just I see in console that it returns '0'.

Here is the send mail method

public function sendMail($emailDataArray)
    {
        Mail::send('mail', $emailDataArray, function($message) use ($emailDataArray)
        {
            $message->to('webmail')->subject('New Online Estimate');
            $message->from('webmail');
        });

        return;
    }

That means my project is connected successfully with the webmail but unfortunately mail doesn't send.

I have already tried with 'sendmail' and 'mail' drive

Anybody Help Please.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire