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

amin93je's avatar

SHARED HOSTING PLESK + LARAVEL

How to integrate plesk mail into laravel .env..

i show you my code in .env

MAIL_DRIVER=smtp
MAIL_HOST=xxx.xx.xxx.248
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=xxxxx
MAIL_ENCRYPTION=ssl

im run artisan config:cache and , website .

error come like this :

Connection could not be established with host xxx.xx.xxx.248 [ #0]
0 likes
5 replies
mlaraei's avatar

check your .env file is correctly and then check your encryption type. recommended to use tls encryption for send email.

skoobi's avatar

The mail host is normally something like

mail.domain.com

So in pleas when you setup a new email account you should be able to find the settings to setup that email address

amin93je's avatar

@skoobi i'm follow your guide.. @mlaraei error come with this

Connection could not be established with host mail.xxx.com.my [ #0]

my .env

MAIL_DRIVER=smtp
MAIL_HOST=mail.xxx.com.my
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=ssl
skoobi's avatar

The only other thing I can think of is the ports. If your using SMTP on an insecure network then it's 25 or if it's secure it's 465 or 463 also try the encryption to tls

So the settings will be like so for secured

// Secured
MAIL_DRIVER=smtp
MAIL_HOST=mail.xxx.com.my
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls


// In-Secure
MAIL_DRIVER=smtp
MAIL_HOST=mail.xxx.com.my
MAIL_PORT=25
[email protected]
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=none
amin93je's avatar
amin93je
OP
Best Answer
Level 1

@SKOOBI - i'm try to change port like what are you said..

Error with port 465

Connection to tcp://mail.xxx.com.my:465 Timed Out

Error with port 463

Connection could not be established with host mail.xxx.com.my [No connection could be made because the target machine actively refused it. #10061]

Error with port 25

Connection could not be established with host mail.xxx.com.my [Unable to find the socket transport "none" - did you forget to enable it when you configured PHP? #23]

[SOLVED]: i'm changed mail client mail.domain.com.my to webmail.domain.com.my

Please or to participate in this conversation.