Are you getting errors or are the mails ending up in spam? Try sending a test email to https://www.mail-tester.com/
It could be due to a missing or wrong spf record
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I am trying to integrate email into my Laravel application. I am not using mailtrap or google's SMTP. My domain provider has an email server. I am planning to use that email server. I have put all the environment settings but am still unable to send emails to my Gmail account. However, If I send an email to the same email account (from which the email is being sent, which is an email account of my domain) it works. Did anyone face this issue?
My env
MAIL_MAILER=smtp
MAIL_HOST=mail.domain.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=secrect
MAIL_ENCRYPTION=null
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Route:
Route::get('mail', function () {
$email = "[email protected]";
$mail_data = ['verification_code' => 'aaa', 'name' => 'name'];
// Mail::to('[email protected]')->send(new RegistrationEmail($data));
// dd(env('MAIL_USERNAME'), env('MAIL_PASSWORD'), env('MAIL_FROM_ADDRESS'));
Mail::send('mail.registration-email', $mail_data, function ($message) use($email) {
$message->from(env('MAIL_USERNAME'), 'Test');
$message->to($email)->subject('SUB');
});
});
Using Laravel 7
Please or to participate in this conversation.