Windows10 + Laragon 3.1.2 + OctoberCMS (Last version)

  • | 644 points

    Hi, all,

    Congrates Leokhoa for this Laragon... Will simplify a lot of things for lot of guys :-) !

    I use it to work and learn a frameWork called OctoberCMS (Based on Laravel as well ;-))...

    All is perfect, even virtualhosts I succed in good work without .dev... (y) (My local URL is...: http://p ! ! ! ("p" as inital of project ;-) )

    I've only have got one trouble...:

    When I test email with your own button 'test email': OK
    When I use mail() in a plugin in my framework OctoberCMS: OK
    But when I use swiftmailer with this code:

    $vars = [
          'name'    => 'Lionel',
          'email'   => '',
          'content' => 'Mon message (Issu de la page d\'accueil'
        if (1) // Just for easy active or inactive this part above for tests
               Mail::send('mypseudo.testingplugin::mail.message', $vars, function ($message) 
                    $message->to('', 'Lionel');
                    $message->subject('Nouveau message depuis mon plugin...');

    and of course, the email's template in

    <p>You got a message from {{name }} at {{email}}</p>
    {{ content }}

    This exactly same code run very well, even in a virtualbox with a linux based configuration... (The copy is strictly the same with use of a complete private gitlab deposit...)

    Do you have an idea what I have to do for this run with Laragon too ?


  • administrators
    | 132054 points

    Hi @GrCOTE7 :
    Many thanks for your congrats :)

    Laragon uses PHPMailer under the hood, so you can use mail function easily.
    I think you can set OctoberCMS to use mail function to send mail. However, if you prefer to use SwiftMailer, you should also check SwiftMailer's logs to see if it needs other configurations (such as port, protocol,...)

  • | 644 points

    @leokhoa Yes... Thanks for your answer...

    Since, I try to use swiftmailer, with this code wich run well (laragon 's email notification OK + real email OK) :

        if (1) {
          $transport = Swift_MailTransport::newInstance();
          $mailer    = \Swift_Mailer::newInstance($transport);
          $message   = (new \Swift_Message('Hello xxx Email'))->setFrom('')
                                                              ->setBody('Mon message émis depuis le script');

    So, I think the only reason the system OctoberCMS doesn't work immediatly with laragon, isn't a trouble with swiftmailer, but with the system of facade...


    I 'll looking around this... ;-) Again thanks.

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.