本文整理汇总了PHP中CI_Email类的典型用法代码示例。如果您正苦于以下问题:PHP CI_Email类的具体用法?PHP CI_Email怎么用?PHP CI_Email使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CI_Email类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getMailer
function getMailer()
{
$this->ci->load->library('email');
$Email = new CI_Email();
$Email->initialize(array('protocol' => 'smtp', 'smtp_host' => 'infizi.com', 'smtp_user' => '[email protected]', 'smtp_pass' => 'Kb}v]w[t%.@&', 'smtp_port' => '26', 'mailtype' => 'html'));
return $Email;
}
开发者ID:Swift-Jr,项目名称:thmdhc,代码行数:7,代码来源:mailer.php
示例2: MY_Email
/**
* Constructor
*
* @access public
* @return null
*/
function MY_Email($init = TRUE)
{
parent::CI_Email();
if ($init != TRUE) {
return;
}
$this->first_init();
}
开发者ID:grimsmath,项目名称:lavillafdn,代码行数:14,代码来源:MY_Email.php
示例3: initialize
/**
* Initialize preferences
*
* @param array
* @return CI_Email
*/
public function initialize($config = array())
{
$this->CI =& get_instance();
$config['protocol'] = $this->CI->config->item('protocol');
$config['mailtype'] = $this->CI->config->item('mailtype');
$config['smtp_host'] = $this->CI->config->item('smtp_host');
$config['smtp_port'] = $this->CI->config->item('smtp_port');
$config['smtp_user'] = $this->CI->config->item('smtp_user');
$config['smtp_pass'] = $this->CI->config->item('smtp_pass');
$config['newline'] = "\r\n";
return parent::initialize($config);
}
开发者ID:AKCore,项目名称:TastyIgniter,代码行数:18,代码来源:TI_Email.php
示例4: chron_scheduler_send_message
function chron_scheduler_send_message($to, $from, $subject, $message)
{
$em = new \CI_Email();
$em->from($from);
$em->to($to);
$em->subject($subject);
$em->message($message);
return $em->send();
}
开发者ID:ntadmin,项目名称:framework,代码行数:9,代码来源:freepbx-cron-scheduler.php
示例5: backup_email_log
function backup_email_log($to, $from, $subject)
{
$tmp = function_exists('sys_get_temp_dir') ? sys_get_temp_dir() : '/tmp';
$email_options = array('useragent' => 'freepbx', 'protocol' => 'mail');
$email = new CI_Email();
$msg[] = _('BACKUP LOG ATTACHED');
$email->from($from);
$email->to($to);
$email->subject(_('Backup Log:') . $subject);
$email->message(implode("\n", $msg));
$email->attach($tmp . '/backup.log');
$email->send();
unset($msg);
}
开发者ID:lidl,项目名称:backup,代码行数:14,代码来源:functions.inc.php
示例6: finalize_print
/** FINALIZE PRINT TASK
*
* @param $tid - TASK ID
* @param $status - TASK STATUS (STOPPED - PERFORMED)
*
**/
function finalize_print($tid, $status)
{
//global $log;
//$log->info('Task #'.$tid.' print '.$status);
//$log->info('Task #'.$tid.' start finalizing');
//LOAD DB
$db = new Database();
//GET TASK
$task = $db->query('select * from sys_tasks where id=' . $tid);
$reset = false;
//CHECK IF TASK WAS ALREARDY FINALIZED
if ($task['status'] == 'stopped' || $task['status'] == 'performed') {
//$log->info('Task #'.$tid.' already finalized. Exit');
return;
}
//GET TASK ATTRIBUTES
$attributes = json_decode($task['attributes'], TRUE);
$print_type = $attributes['print_type'];
if ($status == 'stopped' && $print_type == 'additive') {
//IF % PROGRESS IS < 0.5 FOR SECURITY REASON I RESET THE BOARD CONTROLLER
$monitor = json_decode(file_get_contents($attributes['monitor']), TRUE);
$percent = $monitor['print']['stats']['percent'];
if ($percent < 0.2) {
/** FORCE RESET CONTROLLER */
$_command = 'sudo python ' . PYTHON_PATH . 'force_reset.py';
shell_exec($_command);
$reset = true;
//$log->info('Task #'.$tid.' reset controller');
}
}
//GET TYPE OF FILE (ADDITIVE OR SUBTRACTIVE) FOR ENDING MACRO
$file = $db->query('select * from sys_files where id=' . $attributes['id_file']);
//UPDATE TASK
update_task($tid, $status);
$_macro_end_print_response = TEMP_PATH . 'macro_response';
$_macro_end_print_trace = TEMP_PATH . 'macro_trace';
/*
if(($file['print_type'] == 'additive') && !$reset){
echo 'sudo python '.PYTHON_PATH.'gmacro.py end_print_additive_safe_zone '.$_macro_end_print_trace.' '.$_macro_end_print_response.' > /dev/null &';
shell_exec('sudo python '.PYTHON_PATH.'gmacro.py end_print_additive_safe_zone '.$_macro_end_print_trace.' '.$_macro_end_print_response.' > /dev/null &');
}
*/
$end_macro = $file['print_type'] == 'subtractive' ? 'end_print_subtractive' : 'end_print_additive';
write_file($_macro_end_print_trace, '', 'w');
chmod($_macro_end_print_trace, 0777);
write_file($_macro_end_print_response, '', 'w');
chmod($_macro_end_print_response, 0777);
//EXEC END MACRO
shell_exec('sudo python ' . PYTHON_PATH . 'gmacro.py ' . $end_macro . ' ' . $_macro_end_print_trace . ' ' . $_macro_end_print_response . ' > /dev/null &');
//$log->info('Task #'.$tid.' end macro: '.$end_macro);
sleep(2);
shell_exec('sudo kill ' . $attributes['pid']);
// SEND MAIL
if (isset($attributes['mail']) && $attributes['mail'] == 1 && $status == 'peformed') {
$user = $db->query('select * from sys_user where id=' . $task['user']);
// CREATE IMAGE TO SEND
write_file($attributes['folder'] . 'print.jpg', '', 'w');
chmod($attributes['folder'] . 'print.jpg', 0777);
// TAKE PICTURE
shell_exec('sudo raspistill -hf -vf -rot 90 --exposure off -awb sun -ISO 400 -w 768 -h 1024 -o ' . $attributes['folder'] . 'print.jpg' . ' -t 0');
$email = new CI_Email();
$config['mailtype'] = 'html';
$email->initialize($config);
$email->from('[email protected]', 'Your Personal Fabricator - Fabtotum');
$email->to($user['email']);
// ATTACH
$email->attach($attributes['folder'] . 'print.jpg');
$email->subject('Your print is finished');
$message = 'Dear <strong>' . ucfirst($user['first_name']) . '</strong>,<br>i want to inform you that the print is finished right now';
$email->message($message);
if (!$email->send()) {
//$log->error('Task #'.$tid.' mail sent to '.$user['email']);
} else {
//$log->info('Task #'.$tid.' mail sent to '.$user['email']);
}
}
$db->close();
//WAIT FOR THE UI TO FINALIZE THE PROCESS
//sleep(7);
//REMOVE ALL TEMPORARY FILES
shell_exec('sudo rm -rf ' . $attributes['folder']);
//$log->info('Task #'.$tid.' end finalizing');
}
开发者ID:pardoc,项目名称:FAB-UI,代码行数:89,代码来源:finalize.php
示例7: define
* This is meant for when using external packaging systems (eg, deb or rpm) to manage
* modules. Package maintainers should set AMPEXTERNPACKAGES to true in /etc/amportal.conf.
* Optionally, the other way is to remove the below lines, and instead just define
* EXTERNAL_PACKAGE_MANAGEMENT as 1. This prevents changing the setting from amportal.conf.
*/
if (!isset($amp_conf['AMPEXTERNPACKAGES']) || $amp_conf['AMPEXTERNPACKAGES'] != 'true') {
define('EXTERNAL_PACKAGE_MANAGEMENT', 0);
} else {
define('EXTERNAL_PACKAGE_MANAGEMENT', 1);
}
$modulef = module_functions::create();
// Handle the ajax post back of an update online updates email array and status
//
if ($quietmode && isset($_REQUEST['update_email'])) {
$update_email = $_REQUEST['update_email'];
$ci = new CI_Email();
if (!$ci->valid_email($update_email) && $update_email) {
$json_array['status'] = _("Invalid email address") . ' : ' . $update_email;
} else {
$cm = cronmanager::create($db);
$cm->save_email($update_email);
$cm->set_machineid($_REQUEST['machine_id']);
$json_array['status'] = true;
}
header("Content-type: application/json");
echo json_encode($json_array);
exit;
}
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
global $active_repos;
$loc_domain = 'amp';
开发者ID:nriendeau,项目名称:framework,代码行数:31,代码来源:page.modules.php
示例8: subject
/**
* Overrides the CI_Email subject function because it seems to set the
* subject in the _headers property array instead of the _subject property.
*
* @param string the email subject
* @return Postmark
*/
public function subject($subject)
{
parent::subject($subject);
$this->_subject = $subject;
return $this;
}
开发者ID:ramirors,项目名称:DD-Auth,代码行数:13,代码来源:Postmark.php
示例9: sendEmail
/**
* Send an email to a user
* @param int $id The user ID
* @param string $subject The email subject
* @param string $body The email body
*/
public function sendEmail($id, $subject, $body)
{
$user = $this->getUserByID($id);
if (empty($user) || empty($user['email'])) {
return false;
}
$email_options = array('useragent' => $this->brand, 'protocol' => 'mail');
$email = new \CI_Email();
//TODO: Stop gap until sysadmin becomes a full class
if (!function_exists('sysadmin_get_storage_email') && $this->FreePBX->Modules->checkStatus('sysadmin') && file_exists($this->FreePBX->Config()->get('AMPWEBROOT') . '/admin/modules/sysadmin/functions.inc.php')) {
include $this->FreePBX->Config()->get('AMPWEBROOT') . '/admin/modules/sysadmin/functions.inc.php';
}
$femail = $this->FreePBX->Config()->get('AMPUSERMANEMAILFROM');
if (function_exists('sysadmin_get_storage_email')) {
$emails = sysadmin_get_storage_email();
if (!empty($emails['fromemail']) && filter_var($emails['fromemail'], FILTER_VALIDATE_EMAIL)) {
$femail = $emails['fromemail'];
}
}
$from = !empty($femail) ? $femail : get_current_user() . '@' . gethostname();
$email->from($from);
$email->to($user['email']);
$email->subject($subject);
$email->message($body);
$email->send();
}
开发者ID:umjinsun12,项目名称:dngshin,代码行数:32,代码来源:Userman.class.php
示例10: MY_Email
/**
* Support PHP4...
*/
function MY_Email()
{
parent::CI_Email();
}
开发者ID:asalce,项目名称:wp-ci,代码行数:7,代码来源:MY_Email.php
示例11: __construct
/**
* Constructor method
*
* @return void
*/
public function __construct($config = array())
{
parent::__construct($config);
//set mail protocol
$config['protocol'] = Settings::get('mail_protocol');
//set a few config items (duh)
$config['mailtype'] = "html";
$config['charset'] = "utf-8";
$config['crlf'] = Settings::get('mail_line_endings') ? "\r\n" : PHP_EOL;
$config['newline'] = Settings::get('mail_line_endings') ? "\r\n" : PHP_EOL;
//sendmail options
if (Settings::get('mail_protocol') == 'sendmail') {
if (Settings::get('mail_sendmail_path') == '') {
//set a default
$config['mailpath'] = '/usr/sbin/sendmail';
} else {
$config['mailpath'] = Settings::get('mail_sendmail_path');
}
}
//smtp options
if (Settings::get('mail_protocol') == 'smtp') {
$config['smtp_host'] = Settings::get('mail_smtp_host');
$config['smtp_user'] = Settings::get('mail_smtp_user');
$config['smtp_pass'] = Settings::get('mail_smtp_pass');
$config['smtp_port'] = Settings::get('mail_smtp_port');
}
$this->initialize($config);
}
开发者ID:nockout,项目名称:tshpro,代码行数:33,代码来源:MY_Email.php
示例12:
/**
* Constructor
*
*/
function __construct()
{
// Call the Email Constructor
parent::__construct();
// Create an instance to CI
$this->CI =& get_instance();
// Retrieve the email protocol
$config['protocol'] = $this->CI->ClanCMS->get_setting('email_protocol');
// Configure sendmail settings
if ($config['protocol'] == 'sendmail') {
// Check the sendmail path
if ($this->CI->ClanCMS->get_setting('email_sendmail_path') == '') {
// Set mail path
$config['mailpath'] = '/usr/sbin/sendmail';
} else {
// Set mail path
$config['mailpath'] = $this->CI->ClanCMS->get_setting('email_sendmail_path');
}
}
// Configure smtp settings
if ($config['protocol'] == 'smtp') {
// Configure additional settings
$config['smtp_host'] = $this->CI->ClanCMS->get_setting('email_smtp_host');
$config['smtp_user'] = $this->CI->ClanCMS->get_setting('email_smtp_user');
$config['smtp_pass'] = $this->CI->ClanCMS->get_setting('email_smtp_pass');
$config['smtp_port'] = $this->CI->ClanCMS->get_setting('email_smtp_port');
$config['smtp_timeout'] = '30';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
}
// Initialize settings
$this->initialize($config);
}
开发者ID:BsWiM,项目名称:The-Clan-CMS-Project,代码行数:37,代码来源:ClanCMS_Email.php
示例13:
/**
* Constructor method
*
* @access public
* @return void
*/
function __construct()
{
parent::__construct();
$this->ci =& get_instance();
//set mail protocol
$config['protocol'] = $this->ci->settings->mail_protocol;
//set a few config items (duh)
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['crlf'] = '\\r\\n';
$config['newline'] = '\\r\\n';
//sendmail options
if ($this->ci->settings->mail_protocol == 'sendmail') {
if ($this->ci->settings->mail_sendmail_path == '') {
//set a default
$config['mailpath'] = '/usr/sbin/sendmail';
} else {
$config['mailpath'] = $this->ci->settings->mail_sendmail_path;
}
}
//smtp options
if ($this->ci->settings->mail_protocol == 'smtp') {
$config['smtp_host'] = $this->ci->settings->mail_smtp_host;
$config['smtp_user'] = $this->ci->settings->mail_smtp_user;
$config['smtp_pass'] = $this->ci->settings->mail_smtp_pass;
$config['smtp_port'] = $this->ci->settings->mail_smtp_port;
}
$this->initialize($config);
}
开发者ID:vmichnowicz,项目名称:pyrocms,代码行数:35,代码来源:MY_Email.php
示例14: array
/**
*
*/
function __construct()
{
date_default_timezone_set('Asia/Calcutta');
$ci = CI::get_instance();
$ci->load->Model('Email_settings/Mdl_email_settings');
//load email settings model
$smtp = $ci->Mdl_email_settings->toArray();
//get object valeus in array
$config = array();
$config['protocol'] = 'smtp';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = $smtp['smtp_host'];
$config['smtp_pass'] = $smtp['smtp_pass'];
// email's password - set smtp values
$config['smtp_user'] = $smtp['smtp_user'];
$config['smtp_port'] = $smtp['smtp_port'];
//gmail port 465 (ssl) and 587 (TSL) required
$config['smtp_timeout'] = 10;
//smtp timeout in seconds
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['validate'] = TRUE;
$config['priority'] = 3;
$config['crif'] = "\r\n";
$config['newline'] = "\r\n";
$config['bcc_batch_mode'] = TRUE;
$config['bcc_batch_size'] = 200;
parent::__construct($config);
}
开发者ID:nkscoder,项目名称:chawri,代码行数:34,代码来源:MY_Email.php
示例15: __construct
public function __construct(array $config = array())
{
parent::__construct($config);
$this->CI =& get_instance();
$this->CI->load->helper('file');
$this->CI->load->model('Shared/Environment');
$this->set_newline("\r\n");
}
开发者ID:CodingWorkshop,项目名称:IEnglishTutors,代码行数:8,代码来源:IET_Email.php
示例16: message
public function message($body, $parse_data = NULL)
{
if (!empty($parse_data)) {
$body = $this->parse_template($body, $parse_data);
}
$body = $this->mailtype === 'html' ? $this->_build_html_mail($body) : strip_tags($body);
return parent::message($body);
}
开发者ID:ududsha,项目名称:TastyIgniter,代码行数:8,代码来源:TI_Email.php
示例17: send
/**
* Send Email
*
* @access public
* @return bool
*/
public function send()
{
$result = parent::send();
if ($result && $this->log_emails) {
$this->_log_email_to_file();
}
return $result;
}
开发者ID:Klaudit,项目名称:aw-datacollection,代码行数:14,代码来源:MY_Email.php
示例18: to
public function to($to)
{
// 이메일 주소를 변경
$this->ci =& get_instance();
$_to = $this->ci->config->item('dev_receive_email');
$to = !$_to ? $to : $_to;
return parent::to($to);
}
开发者ID:elnino08,项目名称:codeigniter_codeingeverbody,代码行数:8,代码来源:MY_Email.php
示例19: array
function __construct($config = array())
{
parent::__construct($config);
// If defined in the config set from/name
if (isset($config['from'])) {
$from = $config['from'];
$name = isset($config['name']) ? $config['name'] : '';
$this->from($from, $name);
}
}
开发者ID:git-ecorise,项目名称:snp,代码行数:10,代码来源:EXT_Email.php
示例20:
/**
* Constructor
*/
function __construct($init = TRUE)
{
parent::__construct();
if ($init != TRUE) {
return;
}
// Make a local reference to the ExpressionEngine super object
$this->EE =& get_instance();
$this->EE_initialize();
}
开发者ID:rmdort,项目名称:adiee,代码行数:13,代码来源:EE_Email.php
注:本文中的CI_Email类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论