<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\EmailSmtp\Admin\Controller; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\View; use ModStart\Admin\Layout\AdminConfigBuilder; use ModStart\Core\Input\Response; use ModStart\Form\Form; use Module\EmailSmtp\Provider\SmtpMailSenderProvider; class ConfigController extends Controller { public function setting(AdminConfigBuilder $A2Tuf) { goto NTcpj; CX9xW: $A2Tuf->formClass('wide'); goto FMsZT; NP15G: $A2Tuf->text('systemEmailSmtpServer', 'SMTP服务器地址'); goto V2xyg; V2xyg: $A2Tuf->switch('systemEmailSmtpSsl', 'SMTP是否为SSL'); goto ZeklX; NTcpj: $A2Tuf->pageTitle('SMTP邮箱设置'); goto PwJWt; ZeklX: $A2Tuf->text('systemEmailSmtpUser', 'SMTP用户'); goto hDucw; hDucw: $A2Tuf->text('systemEmailSmtpPassword', 'SMTP密码'); goto CX9xW; PwJWt: $A2Tuf->switch('systemEmailEnable', '开启SMTP邮件发送'); goto NP15G; FMsZT: return $A2Tuf->perform(); goto TyVUw; TyVUw: } public function test(AdminConfigBuilder $A2Tuf) { goto I1C2V; SQQXg: $A2Tuf->text('email', '测试接收邮箱')->rules('required'); goto O5wcQ; Q0bMH: return $A2Tuf->perform(null, function (Form $OkcU0) { $smBDO = $OkcU0->dataForming(); $c6i2z = $smBDO['email']; $lsv1K = new SmtpMailSenderProvider(); $eTwx_ = View::make('module::EmailSmtp.View.mail.test', array())->render(); $Gs3Xd = $lsv1K->send($c6i2z, $c6i2z, '测试邮件', $eTwx_, array()); if (Response::isError($Gs3Xd)) { return Response::generateError('邮件发送失败：' . $Gs3Xd['msg']); } return Response::generateSuccess('测试邮件成功发送到' . $c6i2z); }); goto jOSYO; O5wcQ: $A2Tuf->formClass('wide'); goto Q0bMH; I1C2V: $A2Tuf->pageTitle('邮件发送测试'); goto SQQXg; jOSYO: } }