<?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 $lZifj) { goto gFyjK; M2wbi: $lZifj->text('systemEmailSmtpPassword', 'SMTP密码'); goto h__9T; h__9T: $lZifj->formClass('wide'); goto Dk1uT; KvE2K: $lZifj->text('systemEmailSmtpServer', 'SMTP服务器地址'); goto EdWv_; EdWv_: $lZifj->switch('systemEmailSmtpSsl', 'SMTP是否为SSL'); goto JnMs3; JnMs3: $lZifj->text('systemEmailSmtpUser', 'SMTP用户'); goto M2wbi; Dk1uT: return $lZifj->perform(); goto G1Y9J; gFyjK: $lZifj->pageTitle('SMTP邮箱设置'); goto xXl3H; xXl3H: $lZifj->switch('systemEmailEnable', '开启SMTP邮件发送'); goto KvE2K; G1Y9J: } public function test(AdminConfigBuilder $lZifj) { goto AoeOj; obbjz: $lZifj->formClass('wide'); goto yVERT; LQDAa: $lZifj->text('email', '测试接收邮箱')->rules('required'); goto obbjz; yVERT: return $lZifj->perform(null, function (Form $yZTO2) { $U8wjN = $yZTO2->dataForming(); $dRXuh = $U8wjN['email']; $N9rqF = new SmtpMailSenderProvider(); $n16LT = View::make('module::EmailSmtp.View.mail.test', array())->render(); $Tbn6c = $N9rqF->send($dRXuh, $dRXuh, '测试邮件', $n16LT, array()); if (Response::isError($Tbn6c)) { return Response::generateError('邮件发送失败：' . $Tbn6c['msg']); } return Response::generateSuccess('测试邮件成功发送到' . $dRXuh); }); goto rl_QQ; AoeOj: $lZifj->pageTitle('邮件发送测试'); goto LQDAa; rl_QQ: } }