JorgeAlberto's avatar

failure to send emails

When you sent mail through laravel they don't leave the same server.

I have any domains on my server

proyecto1.com, proyecto2.com, proyecto3.com

When I send emails with laravel, the emails between these domains are delivered.

in my domain proyecto1.com

    // if delivered
    Mail::send('test', [], function ($msj){ 
        $msj->subject('test'); 
        $msj->to('[email protected]');
    });

    // if delivered
    Mail::send('test', [], function ($msj){ 
        $msj->subject('test'); 
        $msj->to('[email protected]');
    });

    // not delivered
    Mail::send('test', [], function ($msj){ 
        $msj->subject('test'); 
        $msj->to('[email protected]');
    });

I thinked it was a bad server configuration but I did a send with php and the mail if it was delivered.

mail('[email protected]', 'test','test');

I do not know what is the problem. Something similar to this situation has never happened to me.

excuse me for my terrible english

0 likes
4 replies
Snapey's avatar

you need to check the mail config in use

on the server open tinker and do

>>> config('mail')

and check that the settings are correct for your mailserver

JorgeAlberto's avatar

Hi Snapey

 [
     "default" => "smtp",
     "mailers" => [
       "smtp" => [
         "transport" => "smtp",
         "host" => "mail.smartsolutions.com",
         "port" => "465",
         "encryption" => "SSL",
         "username" => "[email protected]",
         "password" => "password",
         "timeout" => null,
         "auth_mode" => null,
       ],
       "ses" => [
         "transport" => "ses",
       ],
       "mailgun" => [
         "transport" => "mailgun",
       ],
       "postmark" => [
         "transport" => "postmark",
       ],
       "sendmail" => [
         "transport" => "sendmail",
         "path" => "/usr/sbin/sendmail -bs",
       ],
       "log" => [
         "transport" => "log",
         "channel" => null,
       ],
       "array" => [
         "transport" => "array",
       ],
     ],
     "from" => [
       "address" => "[email protected]",
       "name" => "${Smart Solutions}",
     ],
     "markdown" => [
       "theme" => "default",
       "paths" => [
         "C:\xampp2\htdocs\tracker\resources\views/vendor/mail",
       ],
     ],
   ]

the settings are correct

I'm testing with miler and it works fine but I don't know what problem I have with laravel

guybrush_threepwood's avatar

Hi @jorgealberto

Where are you hosting your project?

Some providers impose limitations on sending e-mails. You need to ask them to enable it first, or they require you validate the recipient's e-mail address before sending, etc.

JorgeAlberto's avatar

hi @guybrush_threepwood

My project is hosted on hostgator. I think if it is laravel, because I updated my project, and I am now using the miler package, and with this package if the emails are being delivered

I tried to see how laravel does the submissions but I didn't see a problem.

I just need to review the swiftmailer package

Please or to participate in this conversation.