php - How to load eden with composer? -
i want write application uses parts of mailer part of eden library.
i have required via composer.json
:
"require": { "eden/mail": "^1.0", ...
it seems though library isn't autloaded properly, call eden via eden('mail')->smtp(...)
function leads to:
php fatal error: call undefined function kopernikus\massmailer\service\eden() in ~/src/massmailer/src/kopernikus/massmailer/service/edenmailerfactory.php on line 20
the quick setup guides handles case one-file approach via:
include('eden.php'); eden('debug')->output('hello world'); //--> hello world
i don't want add huge libary file , include manually. autoloading seems works fine, have use class directly instead of going eden()
function:
use eden\mail\smtp; yourclass { $smtp = new smtp( $host, $user, $pass, $port = null, $ssl = false, $tls = false ); }
the autoloading seems works fine basically, can use class directly instead of going eden()
function:
use eden\mail\smtp; yourclass { ... $smtp = new smtp( $host, $user, $pass, $port, $ssl, $tls ); }
yet weird errors when trying send mail.
[eden\core\exception] both physical , virtual method eden\mail\smtp->_getplainbody()
i want go composer route.
it seems have include file via include-path
option or add someting autoload
, yet unsure.
how load eden mailer component composer way?
not solution question direclty, managed circumvent issue switching "nette/mail"
.
composer remove eden/mail composer require nette/mail
the smtp worked fine me via:
$options = [ 'host' => 'smtp.gmail.com', 'username' => 'your_account', 'password' => 'your_password', 'secure' => 'ssl', ]; $mailer = new nette\mail\messagesmtpmailer($options); $message = new nette\mail\message(); $message->setfrom('my.mail@gmail.com'); $message->setbody('fnord'); $message->setsubject('foo'); $message->addto(sendto@gmail.com); $mailer->send($message);
Comments
Post a Comment