Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 30097

Laravel 5 Mail::raw works in tinker but doesn't in app

$
0
0

I've a very strange issue sending SMTP email from Laravel

Mail::raw('Email body', function ($message) use ($filename) {
            $message->from('sender@email.com', 'Ordini')
              ->to('user@email.com')
              ->subject('subject')
              ->attach(storage_path($filename));
        });

This code actually works within server's tinker environment but it doesn't when it's executed within controller.

I've double checked .env and config/mail.php, everything is fine

The server mail is my client's smtp mail server

I also tried without any attachment

The response is "Expected response code 250 but got an empty response"

I can't figure out why it works in tinker while it doesn't in app. What's the difference?

Thanks in advice


Viewing all articles
Browse latest Browse all 30097

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>