Windows10 + Laragon 3.1.2 + OctoberCMS (Last version)
-
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' => 'ddd@com.com', 'content' => 'Mon message (Issu de la page d\'accueil' ]; dump($vars); if (1) // Just for easy active or inactive this part above for tests { Mail::send('mypseudo.testingplugin::mail.message', $vars, function ($message) { $message->to('MyEmail@gmail.com', 'Lionel'); $message->subject('Nouveau message depuis mon plugin...'); }); }
and of course, the email's template in
views/mail/message.htm<p>You got a message from {{name }} at {{email}}</p> <hr> <strong>Message</strong><br> {{ 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 ?
Thanks
-
Hi @GrCOTE7 :
Many thanks for your congratsLaragon uses PHPMailer under the hood, so you can use
mail
function easily.
I think you can set OctoberCMS to usemail
function to send mail. However, if you prefer to useSwiftMailer
, you should also check SwiftMailer's logs to see if it needs other configurations (such asport
,protocol
,...)
-
@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('MyRealEmail@gmail.com') ->setTo('MyRealEmail@gmail.com') ->setBody('Mon message émis depuis le script'); $mailer->send($message); }
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...
Mail::send()
I 'll looking around this...
Again thanks.