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

Sharim's avatar

Failed to Send Emails From My Laravel Application Using Cpanel

I'm trying to send 2 emails when user will submit the contact form. 1 should be sent to the user email & the other should be sent to my own email. My .env file look like this:

MAIL_MAILER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=m.s***********@gmail.com
MAIL_PASSWORD='************'
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=m.s***********@gmail.com
MAIL_FROM_NAME="${APP_NAME}"

I'm sending the emails from controller like this:

dd($request->email);
Mail::to($request->email)->bcc('[email protected]')->send(new ContactSubmit($contact));

I'm receiving all the emails on [email protected] but not receiving on any other domain. dd($request->email); is showing me correct emails.

Before I was trying to send emails from my own domain:

[email protected]

But I was receiving this error in my inbox:

SMTP error from remote mail server after end of data:
    552 5.2.0 xkfupRYgo20R2xkfupkpjt :CPANEL: Access to this mail system has been blocked for xh******** due to spam activity. Spam was seen coming from this account, and possibly other scripts running in it. For help resolving the issue, see http://x.co/spamclean. Once the compromise has been cleaned, please contact customer support to remove the block.
0 likes
2 replies
Snapey's avatar

why would you choose to send email through gmail?

It never ceases to amaze me that people are surprised when they get issues

Sharim's avatar

@Snapey Sir as I mentioned, I tried my own cpanel emails as well. But I'm getting error that the mail system has been blocked me. Moreover I have other laravel projects on the same cpanel account and I'm sending emails on the same way. Its all working fine but I'm facing problem only with 1 project.

Please or to participate in this conversation.