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


PHP Mail::from方法代码示例

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


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

示例1: initialize

	public static function initialize($delegate, $value, $user="", $pass="", $from=""){
		self::$delegate = $delegate;
		self::$value = $value;
		self::$user = $user;
		self::$pass = $pass;
		self::$from = $from;
	}
开发者ID:nimitz92,项目名称:snowblozm-lite,代码行数:7,代码来源:Mail.class.php

示例2: template_new_gameserver_mail

 public static function template_new_gameserver_mail($param, $is_resend = false)
 {
     $param = json_decode(json_encode($param), FALSE);
     $user_name = str_replace('@gameloft.com', '', $_SERVER['REMOTE_USER']);
     $user_name = str_replace('.', ' ', ucfirst($user_name));
     //$cc[] = MAIL_MEX;
     foreach ($param as $key => $value) {
         unset($to);
         unset($cc);
         unset($bcc);
         $to[] = ENVIRONMENT == LOCAL || ENVIRONMENT == BETA ? $_SERVER['REMOTE_USER'] : MAIL_OGI;
         $cc[] = ENVIRONMENT == LOCAL || ENVIRONMENT == BETA ? $_SERVER['REMOTE_USER'] : MAIL_MEX;
         $dolly_users = explode(',', $param->{$key}->dolly_users);
         foreach ($dolly_users as $key2 => $value2) {
             if (array_search($value2, $dolly_users)) {
                 if ($value2 == $param->{$key}->requested_by) {
                     unset($dolly_users[$key2]);
                 } else {
                     $cc[] = $value2;
                 }
             }
         }
         $product = Product::load($param->{$key}->product_id)->to_array();
         $product_name = $product['name'];
         $tpl = $param->{$key};
         $tpl->server_type = $key;
         $tpl->comments = $param->{$key}->comments_ogi;
         $tpl->dolly_users = $param->{$key}->dolly_users;
         //Get email template
         ob_start();
         $subject = '[TUNA][chklst] ' . $param->{$key}->environment . ' ' . $key . ' checklist for ' . $product_name;
         include 'mail_templates/new_gameserver_checklist.php';
         $body = ob_get_contents();
         ob_end_clean();
         $m = new Mail('text/plain');
         $m->from($_SERVER['REMOTE_USER']);
         $m->to(@implode(',', $to));
         $m->cc(@implode(',', $cc));
         $m->bcc(@implode(',', $bcc));
         $m->subject($subject);
         $m->body($body);
         $m->send();
     }
     TunaLog::info_log(__CLASS__, __FUNCTION__, $_SERVER['REMOTE_USER'], '');
 }
开发者ID:xpeknw,项目名称:vc,代码行数:45,代码来源:Mail.class.php

示例3: from

 public static function from($mail, $name = null)
 {
     self::$from = self::format($mail, $name);
 }
开发者ID:joksnet,项目名称:php-old,代码行数:4,代码来源:wordaday.php

示例4: tryToSendTheMailOrThrowARuntimeException

 /**
  * @param Mail $mail
  * @throws RuntimeException
  */
 public function tryToSendTheMailOrThrowARuntimeException(Mail $mail)
 {
     $couldNotSent = !mail($mail->to(), $mail->subject(), $mail->content(), 'From: ' . $mail->from());
     if ($couldNotSent) {
         throw new RuntimeException('could not sent the mail' . PHP_EOL . 'values: ' . var_export($mail, true));
     }
 }
开发者ID:stevleibelt,项目名称:refactoring,代码行数:11,代码来源:04_refactored.php

示例5: forgottenPassword

 /**
  * Display and treat the form when the user forgot his password
  */
 public function forgottenPassword()
 {
     $form = new Form(array('id' => 'forgotten-password-form', 'fieldsets' => array('form' => array(new EmailInput(array('name' => 'email', 'required' => true, 'label' => Lang::get($this->_plugin . '.forgotten-pwd-form-email-label')))), 'submits' => array(new SubmitInput(array('name' => 'valid', 'label' => Lang::get($this->_plugin . '.valid-button'))), new ButtonInput(array('name' => 'cancel', 'label' => Lang::get($this->_plugin . '.cancel-button'), 'href' => App::router()->getUri('login'), 'target' => 'dialog')))), 'onsuccess' => '
             app.dialog(app.getUri("reset-password"));
             app.notify("warning", Lang.get("main.forgotten-pwd-sent-email-message"));
         '));
     if (!$form->submitted()) {
         Lang::addKeysToJavascript($this->_plugin . '.forgotten-pwd-sent-email-message');
         return Dialogbox::make(array('title' => Lang::get($this->_plugin . '.forgotten-pwd-form-title'), 'icon' => 'lock-alt', 'page' => $form));
     } else {
         if ($form->check()) {
             $user = User::getByEmail($form->getData('email'));
             if (!$user) {
                 // The user does not exists. For security reasons,
                 // reply the email was successfully sent, after a random delay to work around robots
                 usleep(mt_rand(0, 500) * 100);
                 return $form->response(Form::STATUS_SUCCESS, Lang::get($this->_plugin . '.forgotten-pwd-sent-email-message'));
             }
             try {
                 // The user exists, send an email with a 6 chars random verification code
                 $code = Crypto::generateKey(6);
                 // Register the verification code in the session
                 App::session()->setData('forgottenPassword', array('email' => $form->getData('email'), 'code' => Crypto::aes256Encode($code)));
                 $mail = new Mail();
                 $mail->from(Option::get($this->_plugin . '.mailer-from'), Option::get($this->_plugin . '.mailer-from-name'))->to($form->getData('email'))->subject(Lang::get($this->_plugin . '.reset-pwd-email-title', array('sitename' => Option::get($this->_plugin . '.sitename'))))->title(Lang::get('main.reset-pwd-email-title', array('sitename' => Option::get('main.sitename'))))->content(View::make(Plugin::current()->getView('reset-password-email.tpl'), array('sitename' => Option::get($this->_plugin . '.sitename'), 'code' => $code)))->send();
                 return $form->response(Form::STATUS_SUCCESS, Lang::get($this->_plugin . '.forgotten-pwd-sent-email-message'));
             } catch (\Exception $e) {
                 return $form->response(Form::STATUS_ERROR, DEBUG_MODE ? $e->getMessage() : Lang::get($this->_plugin . '.forgotten-pwd-form-error'));
             }
         }
     }
 }
开发者ID:elvyrra,项目名称:hawk,代码行数:35,代码来源:LoginController.php


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