本文整理汇总了PHP中CI_Email::send方法的典型用法代码示例。如果您正苦于以下问题:PHP CI_Email::send方法的具体用法?PHP CI_Email::send怎么用?PHP CI_Email::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI_Email
的用法示例。
在下文中一共展示了CI_Email::send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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();
}
示例3: send_email
protected function send_email($to, $subject, $text)
{
$this->load->library('email');
$this->email->from(MAIL_FROM_ADDRESS, MAIL_FROM_NAME);
$this->email->bcc($to);
$this->email->bcc_batch_mode = true;
$this->email->subject($subject);
$this->email->message($text);
$this->email->batch_bcc_send();
return $this->email->send();
}
示例4: 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);
}
示例5: 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('noreplay@fabtotum.com', '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');
}
示例6: send
public function send($auto_clear = true)
{
$auto_clear = !empty($auto_clear);
if ($this->mailer_engine == 'phpmailer') {
if ($this->mailtype == 'html') {
// Modified by Ivan Tcholakov, 01-AUG-2015.
// See https://github.com/ivantcholakov/codeigniter-phpmailer/issues/8
//$this->phpmailer->AltBody = $this->_get_alt_message();
$this->phpmailer->AltBody = str_replace(array('{unwrap}', '{/unwrap}'), '', $this->_get_alt_message());
//
}
$result = (bool) $this->phpmailer->send();
if ($result) {
$this->_set_error_message('lang:email_sent', $this->_get_protocol());
if ($auto_clear) {
$this->clear();
}
} else {
$this->_set_error_message($this->phpmailer->ErrorInfo);
}
} else {
if ($this->_is_ci_3) {
$result = parent::send($auto_clear);
} else {
$result = parent::send();
}
}
return $result;
}
示例7: send
public function send($auto_clear = true)
{
$auto_clear = !empty($auto_clear);
if ($this->mailer_engine == 'phpmailer') {
if ($this->mailtype == 'html') {
$this->phpmailer->AltBody = $this->_get_alt_message();
}
$result = (bool) $this->phpmailer->send();
if ($result) {
$this->_set_error_message('lang:email_sent', $this->_get_protocol());
if ($auto_clear) {
$this->clear();
}
} else {
$this->_set_error_message($this->phpmailer->ErrorInfo);
}
} else {
if ($this->_is_ci_3) {
$result = parent::send($auto_clear);
} else {
$result = parent::send();
}
}
return $result;
}
示例8: 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();
}
示例9: send
function send($queue = FALSE)
{
$CI =& get_instance();
if ($queue == FALSE) {
// are we using Postmark?
if (empty($this->_attach_name) and setting('postmark_api') != '' and function_exists('curl_init') and $this->_plaintext_from_email == $CI->config->item('site_email')) {
// create to, cc, and bcc strings
$to = is_array($this->_recipients) ? implode(', ', $this->_recipients) : $this->_recipients;
$cc = is_array($this->_cc_array) ? implode(', ', $this->_cc_array) : $this->_cc_array;
$bcc = is_array($this->_bcc_array) ? implode(', ', $this->_bcc_array) : $this->_bcc_array;
// prepare data array
$data = array();
$data['Subject'] = $this->_plaintext_subject;
$data['From'] = "{$this->_plaintext_from_name} <{$this->_plaintext_from_email}>";
$data['To'] = $to;
if (!empty($cc)) {
$data['Cc'] = $cc;
}
if (!empty($bcc)) {
$data['Bcc'] = $bcc;
}
if (strip_tags($this->_plaintext_body) != $this->_plaintext_body) {
$data['HtmlBody'] = $this->_plaintext_body;
} else {
$data['TextBody'] = $this->_plaintext_body;
}
$encoded_data = json_encode($data);
$headers = array('Accept: application/json', 'Content-Type: application/json', 'X-Postmark-Server-Token: ' . setting('postmark_api'));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.postmarkapp.com/email');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$return = curl_exec($ch);
if (curl_error($ch) != '') {
show_error(curl_error($ch));
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (intval($httpCode / 100) != 2) {
$message = json_decode($return)->Message;
show_error('Error while mailing. Postmark returned HTTP code ' . $httpCode . ' with message "' . $message . '"');
}
} else {
// send using traditional means
parent::send();
}
} else {
// let's put this in the queue
// do we have a mail queue folder?
$mail_queue_folder = setting('path_writeable') . 'mail_queue';
if (!file_exists($mail_queue_folder)) {
$CI->settings_model->make_writeable_folder($mail_queue_folder, TRUE);
}
// if this body is the same as the last,
// then the body file doesn't need to be regenerated
if (empty($this->_previous_body) or $this->_plaintext_body != $this->_previous_body) {
// create the file
if (!function_exists('write_file')) {
$CI->load->helper('file');
}
$body_file = md5($this->_plaintext_body) . '.email';
write_file($mail_queue_folder . '/' . $body_file, $this->_plaintext_body);
$this->_previous_body = $this->_plaintext_body;
$this->_previous_body_file = $body_file;
} else {
$body_file = $this->_previous_body_file;
}
if (is_array($this->_recipients)) {
$to = implode(', ', $this->_recipients);
} else {
$to = $this->_recipients;
}
$CI->db->insert('mail_queue', array('`to`' => $to, '`from_name`' => $this->_plaintext_from_name, '`from_email`' => $this->_plaintext_from_email, '`subject`' => $this->_plaintext_subject, '`body`' => $body_file, '`date`' => date('Y-m-d H:i:s'), '`wordwrap`' => $this->wordwrap == TRUE ? '1' : '0', '`is_html`' => $this->mailtype == 'html' ? '1' : '0'));
unset($CI);
return TRUE;
}
}
示例10: foreach
function store_backup()
{
foreach ($this->b['storage_servers'] as $s) {
$s = $this->s[$s];
switch ($s['type']) {
case 'local':
$path = backup__($s['path']) . '/' . $this->b['_dirname'];
//ensure directory structure
if (!is_dir($path)) {
mkdir($path, 0755, true);
}
//would rather use the native copy() here, but by defualt
//php doesnt support files > 2GB
//see here for a posible solution:
//http://ca3.php.net/manual/en/function.fopen.php#37791
$cmd[] = fpbx_which('cp');
$cmd[] = $this->b['_tmpfile'];
$cmd[] = $path . '/' . $this->b['_file'] . '.tgz';
exec(implode(' ', $cmd), $error, $status);
unset($cmd, $error);
if ($status !== 0) {
$this->b['error'] = 'Error copying ' . $this->b['_tmpfile'] . ' to ' . $path . '/' . $this->b['_file'] . '.tgz: ' . $error;
backup_log($this->b['error']);
}
//run maintenance on the directory
$this->maintenance($s['type'], $s);
break;
case 'email':
//TODO: set agent to something informative, including fpbx & backup versions
$email_options = array('useragent' => 'freepbx', 'protocol' => 'mail');
$email = new \CI_Email();
//Generic email
$from = 'freepbx@freepbx.local';
//If we have sysadmin and "from is set"
if (function_exists('sysadmin_get_storage_email')) {
$emails = sysadmin_get_storage_email();
//Check that what we got back above is a email address
if (!empty($emails['fromemail']) && filter_var($emails['fromemail'], FILTER_VALIDATE_EMAIL)) {
$from = $emails['fromemail'];
}
}
//If the user set an email in advanced settings it wins, otherwise take whatever won above.
$from = filter_var($this->amp_conf['AMPBACKUPEMAILFROM'], FILTER_VALIDATE_EMAIL) ? $this->amp_conf['AMPBACKUPEMAILFROM'] : $from;
$msg[] = _('Name') . ': ' . $this->b['name'];
$msg[] = _('Created') . ': ' . date('r', $this->b['_ctime']);
$msg[] = _('Files') . ': ' . $this->manifest['file_count'];
$msg[] = _('Mysql Db\'s') . ': ' . $this->manifest['mysql_count'];
$msg[] = _('astDb\'s') . ': ' . $this->manifest['astdb_count'];
$email->from($from);
$email->to(backup__($s['addr']));
$email->subject($this->amp_conf['FREEPBX_SYSTEM_IDENT'] . ' ' . _('Backup') . ' ' . $this->b['name']);
$body = implode("\n", $msg);
// If the backup file is more than 25MB, yell
$encodedsize = ceil(filesize($this->b['_tmpfile']) / 3) * 4;
if ($encodedsize > 26214400) {
$email->subject($this->amp_conf['FREEPBX_SYSTEM_IDENT'] . ' ' . _('Backup ERROR (exceeded SMTP limits)') . ' ' . $this->b['name']);
$email->message(_('BACKUP NOT ATTACHED') . "\n" . _('The backup file exceeded the maximum SMTP limits of 25MB. It was not attempted to be sent. Please shrink your backup, or use a different method of transferring your backup.') . "\n{$body}\n");
} elseif ($encodedsize > $s['maxsize']) {
$email->subject($this->amp_conf['FREEPBX_SYSTEM_IDENT'] . ' ' . _('Backup ERROR (exceeded soft limit)') . ' ' . $this->b['name']);
$email->message(_('BACKUP NOT ATTACHED') . "\n" . _('The backup file exceeded the soft limit set in SMTP configuration (%s bytes). It was not attempted to be sent. Please shrink your backup, or use a different method of transferring your backup.') . "\n{$body}\n");
} else {
$email->message($body);
$email->attach($this->b['_tmpfile']);
}
$email->send();
unset($msg);
break;
case 'ftp':
//subsitute variables if nesesary
$s['host'] = backup__($s['host']);
$s['port'] = backup__($s['port']);
$s['user'] = backup__($s['user']);
$s['password'] = backup__($s['password']);
$s['path'] = trim(backup__($s['path']), '/');
$fstype = isset($s['fstype']) ? $s['fstype'] : 'auto';
$path = $s['path'] . '/' . $this->b['_dirname'];
$connection = new Connection($s['host'], $s['user'], $s['password'], $s['port'], 90, $s['transfer'] == 'passive');
try {
$connection->open();
} catch (\Exception $e) {
$this->b['error'] = $e->getMessage();
backup_log($this->b['error']);
return;
}
$wrapper = new FTPWrapper($connection);
$permFactory = new PermissionsFactory();
switch ($fstype) {
case 'auto':
$ftptype = $wrapper->systype();
if (strtolower($ftptype) == "unix") {
$fsFactory = new FilesystemFactory($permFactory);
} else {
$fsFactory = new WindowsFilesystemFactory();
}
break;
case 'unix':
$fsFactory = new FilesystemFactory($permFactory);
break;
case 'windows':
$fsFactory = new WindowsFilesystemFactory();
//.........这里部分代码省略.........
示例11: die_fax
$email->message($msg);
switch ($var['attachformat']) {
case 'both':
$pdf = fax_file_convert('tif2pdf', $var['file'], '', true);
$email->attach($pdf);
$email->attach($tif);
break;
case 'tif':
$email->attach($tif);
break;
case 'pdf':
$pdf = fax_file_convert('tif2pdf', $var['file'], '', true);
$email->attach($pdf);
break;
}
$email->send();
}
if ($var['keep_file'] === false) {
unlink($tif);
if (isset($pdf)) {
unlink($pdf);
}
}
function die_fax($error)
{
dbug('email-fax', $error);
die($error);
}
/**
* Parses $GLOBALS['argv'] for parameters and assigns them to an array.
*
示例12: send
/**
* Send the email
*
* @access public
* @return boolean
*/
public function send()
{
//check the send out emails flag
if ($this->_send_out) {
return parent::send();
}
}
示例13: send
/**
* Replacement of CI_Email send function
* Added: App email data added to CI_Email (from, to, etc) before actual send.
*
* @return boolean Whether or not the email is sent
*/
public function send()
{
$valid = $this->_prepare_send();
if ($valid) {
// set CI_Email
parent::from($this->_data['from_email'], $this->_data['from_name']);
parent::to($this->_data['to']);
parent::subject($this->_data['subject']);
parent::message($this->_data['message']);
if (!empty($this->_data['alt_message'])) {
parent::set_alt_message($this->_data['alt_message']);
}
$send = parent::send();
if ($send) {
// log email
$this->ci->load->library('app_log');
$this->ci->app_log->log('app_email', $this->_data['subject'] . ' (to: ' . $this->_data['to'][0] . ')');
}
return $send;
} else {
// mail not send, see error for details
return FALSE;
}
}
示例14: forwardMessageByExtension
/**
* Forward a voicemail message to a new folder
* @param string $msg The message ID
* @param int $ext The voicemail extension message is coming from
* @param int $rcpt The recipient, voicemail will wind up in the INBOX
*/
public function forwardMessageByExtension($msg, $ext, $to)
{
$fromVM = $this->getVoicemailBoxByExtension($ext);
$messages = $this->getMessagesByExtension($ext);
if (isset($messages['messages'][$msg])) {
$info = $messages['messages'][$msg];
$txt = $info['path'] . "/" . $info['fid'] . ".txt";
if (file_exists($txt) && is_readable($txt)) {
$toVM = $this->getVoicemailBoxByExtension($to);
$context = $toVM['vmcontext'];
$toFolder = $this->vmPath . '/' . $context . '/' . $to . '/INBOX';
if (file_exists($toFolder) && is_writable($toFolder)) {
$files = array();
$files[] = $txt;
$movedFiles = array();
foreach ($info['format'] as $format) {
if (file_exists($format['path'] . "/" . $format['filename'])) {
$files[] = $format['path'] . "/" . $format['filename'];
}
}
//if the folder is empty (meaning we dont have a 0000 file) then set this to 0000
$tname = preg_replace('/([0-9]+)/', '0000', basename($txt));
$vminfotxt = '';
if (!file_exists($toFolder . "/" . $tname)) {
foreach ($files as $file) {
$fname = preg_replace('/msg([0-9]+)/', 'msg0000', basename($file));
copy($file, $toFolder . "/" . $fname);
$movedFiles[] = $toFolder . "/" . $fname;
}
} else {
//Else we have other voicemail data in here so do something else
//figure out the last file in the directory
$oldFiles = glob($toFolder . "/*.txt");
$numbers = array();
foreach ($oldFiles as $file) {
$file = basename($file);
preg_match('/([0-9]+)/', $file, $matches);
$numbers[] = $matches[1];
}
rsort($numbers);
$next = sprintf('%04d', $numbers[0] + 1);
foreach ($files as $file) {
$fname = preg_replace('/msg([0-9]+)/', "msg" . $next, basename($file));
copy($file, $toFolder . "/" . $fname);
$movedFiles[] = $toFolder . "/" . $fname;
}
}
//send email from/to new mailbox
$vm = $this->FreePBX->LoadConfig->getConfig("voicemail.conf");
$emailInfo = array("normal" => array("body" => !empty($vm['general']['emailbody']) ? $vm['general']['emailbody'] : 'Dear ${VM_NAME}:\\n\\n\\tjust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE}, so you might\\nwant to check it when you get a chance. Thanks!\\n\\n\\t\\t\\t\\t--Asterisk\\n', "subject" => !empty($vm['general']['emailsubject']) ? $vm['general']['emailsubject'] : (isset($vm['general']['pbxskip']) && $vm['general']['pbxskip'] == "no" ? "[PBX]: " : "") . 'New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}', "fromstring" => !empty($vm['general']['fromstring']) ? $vm['general']['fromstring'] : 'The Asterisk PBX'), "pager" => array("body" => !empty($vm['general']['pagerbody']) ? $vm['general']['pagerbody'] : 'New ${VM_DUR} long msg in box ${VM_MAILBOX}\\nfrom ${VM_CALLERID}, on ${VM_DATE}', "subject" => !empty($vm['general']['pagersubject']) ? $vm['general']['pagersubject'] : 'New VM', "fromstring" => !empty($vm['general']['pagerfromstring']) ? $vm['general']['pagerfromstring'] : 'The Asterisk PBX'));
$processUser = posix_getpwuid(posix_geteuid());
$from = !empty($vm['general']['serveremail']) ? $vm['general']['serveremail'] : $processUser['name'] . '@' . gethostname();
foreach ($emailInfo as &$einfo) {
$einfo['body'] = str_replace(array('\\n', '\\t'), array("\n", "\t"), $einfo['body']);
$einfo['body'] = str_replace(array('${VM_NAME}', '${VM_MAILBOX}', '${VM_CALLERID}', '${VM_DUR}', '${VM_DATE}', '${VM_MSGNUM}'), array($toVM['name'], $to, $info['callerid'], $info['duration'], $info['origdate'], $info['msg_id']), $einfo['body']);
$einfo['subject'] = str_replace(array('${VM_NAME}', '${VM_MAILBOX}', '${VM_CALLERID}', '${VM_DUR}', '${VM_DATE}', '${VM_MSGNUM}'), array($toVM['name'], $to, $info['callerid'], $info['duration'], $info['origdate'], $info['msg_id']), $einfo['subject']);
}
if (!empty($toVM['email'])) {
$em = new \CI_Email();
if ($toVM['options']['attach'] == "yes") {
$em->attach($info['path'] . "/" . $info['file']);
}
$em->from($from, $emailInfo['normal']['fromstring']);
$em->to($toVM['email']);
$em->subject($emailInfo['normal']['subject']);
$em->message($emailInfo['normal']['body']);
$em->send();
}
if (!empty($toVM['pager'])) {
$em = new \CI_Email();
$em->from($from, $emailInfo['pager']['fromstring']);
$em->to($toVM['email']);
$em->subject($emailInfo['pager']['subject']);
$em->message($emailInfo['pager']['body']);
$em->send();
}
if (isset($toVM['delete']) && $toVM['delete'] == "yes") {
//now delete the voicemail wtf.
foreach ($movedFiles as $file) {
unlink($file);
}
}
//Just for sanity sakes recheck the directories hopefully this doesnt take hours though.
$this->renumberAllMessages($toFolder);
}
}
}
if (!empty($fromVM['context'])) {
$this->astman->VoicemailRefresh($fromVM['context'], $ext);
}
if (!empty($toVM['context'])) {
$this->astman->VoicemailRefresh($toVM['context'], $to);
}
}
示例15: view
$form_name = 'email name';
$subject = 'subject to test email';
// Pass some data into the email templates
$email_data = array();
$email_data['firstname'] = 'Look';
$email_data['lastname'] = 'look';
$email_data['email'] = 'tester@email.com';
define('MB_ENABLED', TRUE);
define('ICONV_ENABLED', TRUE);
$email_sender = new CI_Email($config);
$email_sender->from($from_address, $form_name);
$email_sender->to($to_address);
$email_sender->subject($subject);
$email_sender->message(view('email_template', $email_data));
//$email_sender->set_alt_message(view('email_template', $email_data));
if (!$email_sender->send()) {
exit('error' . 'User::create - Unable to send new user email. Response is as follows:' . $email_sender->print_debugger() . "\n\n");
} else {
echo 'email sent';
}
// Load view function
function view($path, $data)
{
ob_start();
extract($data);
include $path . '.php';
return ob_get_clean();
}
function is_php($version)
{
static $_is_php;