当前位置: 首页>>代码示例>>PHP>>正文


PHP emailer::sendMail方法代码示例

本文整理汇总了PHP中emailer::sendMail方法的典型用法代码示例。如果您正苦于以下问题:PHP emailer::sendMail方法的具体用法?PHP emailer::sendMail怎么用?PHP emailer::sendMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在emailer的用法示例。


在下文中一共展示了emailer::sendMail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: l

         $invalid['Session'] = l($testSession->getLastError());
     }
 } else {
     //if user is asking to receive the activation email again
     if ($paramResendActivate) {
         //build activation link for email template (resetting activation and reset hashes)
         $activationLinkForEmail = Auth::buildHashLink('account.activate.folder', array('username' => $user->username(), 'activation' => $user->activation()), true);
         //set data to be used for replacing placeholders in activation email template
         $emailTplData = array('emailTo' => $user->email(), 'emailFrom' => c::get('site.email.from'), 'emailReply' => c::get('site.email.reply'), 'siteName' => $site->title(), 'activationLink' => $activationLinkForEmail);
         //istantiate new emailer object (the object itself will replace placeholders)
         //the construct props indicate an email template file and a data array
         $emailer = new emailer(c::get('account.email.templates.folder'), c::get('email.template.activation.hash'), c::get('email.template.file.ext'), $emailTplData);
         //if the email template is found
         if ($emailer->doesEmailTemplateExist()) {
             //if email was correclty sent
             if ($emailer->sendMail()) {
                 //add success message
                 $success['Account'] = l('activation.success.resend');
             } else {
                 //add error: mail class returned an error
                 $invalid['Account'] = l('activation.fail.resend');
             }
         } else {
             //add error: email template was not found
             $invalid['Account'] = l('generic.fail.email.template.notFound');
         }
     } else {
         //build activation link for view
         $activationLinkForView = Auth::buildHashLink('account.activate.folder', array('username' => $user->username(), 'resendActivation' => 1), false);
         //add error: invalid or expired hash
         $invalid['Account'] = l('activation.fail.invalid.hash');
开发者ID:alkaest2002,项目名称:risky2,代码行数:31,代码来源:activate.php


注:本文中的emailer::sendMail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。