Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是不是bug #2

Open
yuanzhihai opened this issue Nov 20, 2019 · 2 comments
Open

是不是bug #2

yuanzhihai opened this issue Nov 20, 2019 · 2 comments

Comments

@yuanzhihai
Copy link

$mailer = Mailer::instance(function() {
            return \Swift_SmtpTransport::newInstance(
                'smtp.qq.com', 465, 'ssl' 
            )
            ->setUsername('username')
            ->setPassword('password');
        });

读取的不是自定义配置,最终还是读取config/mail.php里的

@cattong
Copy link
Owner

cattong commented Nov 20, 2019

你可以这样子:
\mailer\lib\Config::init($mailConfig);
$mailer = Mailer::instance();
进行初始化;

@yuanzhihai
Copy link
Author

你可以这样子:
\mailer\lib\Config::init($mailConfig);
$mailer = Mailer::instance();
进行初始化;

$mailer = Mailer::instance(function() {
return \Swift_SmtpTransport::newInstance(
'host', 'port', 'security'
)
->setUsername($config['addr'])
->setPassword($config['pass']);
});
这种方式不可以是吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants