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

convers39's avatar

Send email with only MAIL_HOST setting

I am working on a deployment server, my company asked me to set up the email but only gave me the SMTP server host/ip address.

Literally, NO user account, NO encryption, and NO port info.

The deployment server and the SMTP server are in the same VPN network, and the guy said the setup on the SMTP server is all set.

Of course, I could not send any emails with this setting.

I could not get much info from the internet, is that possible to send an email with only a Host? If yes how can I change the settings?

MAIL_DRIVER=smtp
MAIL_HOST=10.xxx.xxx.xx
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=

Appreciate your help!

0 likes
9 replies
siangboon's avatar

get an email account from the person in-charge...

martinbean's avatar

@convers39 I don’t really know what you’re expecting? If you person in charge of the email server hasn’t given you all the credentials you need, what are you expecting strangers on an Internet forum to be able to do?

convers39's avatar

I know it is a strange question.

And I did ask for account info but the guy in charge insists it is possible to send email without an account and encryption.

I just wonder if that is possible in Laravel.

convers39's avatar

Thank you for your help, I think setting to null makes sence. I set all to null except the mail host, still could not make it work, maybe some other reasons. The guy in charge said the SMTP server is using anonymous authentication and can not issue an account. I gonna use some 3rd party service instead.

Sinnbeck's avatar

You can try adding this to config/mail.php

'auth_mode' => 'plain'
convers39's avatar

Appreciate for your help. You are right the user info and encryption should be null instead of empty. I finally make it work with a default port number 25 + the IP address:

MAIL_DRIVER=smtp
MAIL_HOST=10.xxx.xxx.xx
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

I was missing the port number since the person in charge said no port number was required. I should try that, my fault. Thank you again!

Snapey's avatar

perhaps they are expecting you to choose your own email address and there is no security since its internal?

A polite email requesting the email address and password is probably more effective than asking here...

convers39's avatar

Thank you for your advice. Yes, I did this morning and the guy said it is not possible to issue an account. I am not familiar with the SMTP server things. I tried with this config below and it works (missing the port number).

MAIL_DRIVER=smtp
MAIL_HOST=10.xxx.xxx.xx
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

Please or to participate in this conversation.