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