本文整理汇总了PHP中CI_Email::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CI_Email::__construct方法的具体用法?PHP CI_Email::__construct怎么用?PHP CI_Email::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI_Email
的用法示例。
在下文中一共展示了CI_Email::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: __construct
/**
* Constructor
*
* @access public
* @return void
*/
public function __construct($config = array())
{
//set the user agent to tomatocart
$this->useragent = 'TomatoCart';
//set mail protocol
$this->protocol = EMAIL_TRANSPORT;
//set smpt account info
$this->smtp_host = SMTP_HOST;
$this->smtp_user = SMTP_USERNAME;
$this->smtp_pass = SMTP_PASSWORD;
$this->smtp_port = SMTP_PORT;
$this->smtp_timeout = 30;
//set the smpt encryption
if (EMAIL_SSL == '1') {
$this->smtp_crypto = "ssl";
}
//set emial line feed
if (EMAIL_LINEFEED == 'CRLF') {
$this->newline = "\r\n";
$this->crlf = "\r\n";
}
//set the email formatting
if (EMAIL_USE_HTML == '1') {
$this->mailtype = 'html';
}
//set the send out emails flag
if (SEND_EMAILS == '1') {
$this->_send_out = TRUE;
}
//set the default from email address
$this->from(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER);
parent::__construct($config);
}
示例3:
/**
* 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);
}
示例4: __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);
}
示例5:
/**
* 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);
}
示例6: __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");
}
示例7: __construct
/**
* Extended constructor, which will first load default e-mail configuration from config file and then merge it with provided custom configuration.
* It will also load all default addresses to internal variable.
* @param array<mixed> $config configuration options.
*/
public function __construct($config = array())
{
$this->CI =& get_instance();
$config_default = $this->CI->config->item('email');
$config = array_merge($config_default, $config);
parent::__construct($config);
$this->default_addresses = $this->CI->config->item('email_address');
}
示例8: 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);
}
}
示例9:
/**
* 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();
}
示例10: __construct
/**
* Replacement of CI_Email construct method.
* Added: merge config variables with default app_email config variables.
*
* @param array $config Config settings (same as the CI_Email config) [ optional ]
*/
public function __construct($config = array())
{
$this->ci =& get_instance();
$this->ci->load->language('email');
// load default config from config folder and merge with construct input config
$this->ci->load->config('app_email', TRUE);
// if config is null
$config = !is_array($config) ? array() : $config;
$this->_config = array_merge($this->ci->config->item('app_email'), $config);
parent::__construct($this->_config);
}
示例11: __construct
public function __construct()
{
parent::__construct();
// get the CodeIgniter Object
$CI =& get_instance();
// load config
$CI->load->config('postmark');
// load helpers
$CI->load->helper('file');
$this->api_key = $CI->config->item('postmark_api_key');
}
示例12:
/**
* Constructor - Sets Email Preferences
*
* The constructor can be passed an array of config values
*/
function __construct()
{
parent::__construct();
$this->CI =& get_instance();
$this->protocol = $this->CI->config->item('email_protocal') ? $this->CI->config->item('email_protocal') : 'mail';
// mail/sendmail/smtp
$this->smtp_host = $this->CI->config->item('email_smtp_host');
// SMTP Server. Example: mail.earthlink.net
$this->smtp_user = $this->CI->config->item('email_smtp_user');
// SMTP Username
$this->smtp_pass = $this->CI->config->item('email_smtp_pass');
// SMTP Password
$this->smtp_port = $this->CI->config->item('email_smtp_port');
// SMTP Port
$this->smtp_crypto = $this->CI->config->item('email_smtp_crypto');
// SMTP Encryption. Can be null, tls or ssl.
$this->mailtype = 'html';
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->CI =& get_instance();
}
示例14:
function __construct()
{
parent::__construct();
}
示例15:
function __construct()
{
parent::__construct();
$CI =& get_instance();
}