Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fareedshuja's avatar

stream_set_blocking() expects parameter 1 to be resource, null given

I am trying to sent emails from online server but it does not work. It was working fine in my localhost where I used the mailtrap.io host. but when I uploaded the project to easyname.com, it stopped working and it shows the following error when I run the script.

stream_set_blocking() expects parameter 1 to be resource, null given

This is my .env file

MAIL_DRIVER=smtp MAIL_HOST=smtp.easyname.com MAIL_PORT=465 [email protected] MAIL_PASSWORD=mypasword MAIL_ENCRYPTION=

This is my config/mail.php file

'driver' => env('MAIL_DRIVER', 'smtp'),

'host' => env('MAIL_HOST', 'smtp.easyname.com'),

'port' => env('MAIL_PORT', 465),

'from' => [
    'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
    'name' => env('MAIL_FROM_NAME', 'My Name'),
],

'encryption' => env('MAIL_ENCRYPTION', ''),

'username' => env('MAIL_USERNAME'),

'password' => env('MAIL_PASSWORD'),
0 likes
0 replies

Please or to participate in this conversation.