function __construct($config = array()) { parent::__construct($config); $this->CI =& get_instance(); $this->setFromEmail(Settings_class::get('server_email')); $this->setEmailTitle($GLOBALS['global']['SITE_ADMIN']['email']); }
protected function _process_data($form) { // Process Class & method $process = !empty($form['process']) ? $form['process'] : NULL; // Load class if (!is_null($process)) { $arr = explode('::', $process); // Load the library $class_name = $arr[0]; $method_name = $arr[1]; $this->load->library($class_name); // Execute the method if (method_exists($this->{$class_name}, $method_name)) { return call_user_func($process, $form); } } else { $this->email->send_form_emails($form); } }
function sendmailto($email, $filename) { $this->load->library('my_email'); $subject = 'Permintaan File'; $message = '<p>This message has been sent for testing purposes.</p> ' . $filename; // Get full html: $body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=' . strtolower(config_item('charset')) . '" /> <title>' . html_escape($subject) . '</title> <style type="text/css"> body { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 16px; } </style> </head> <body> ' . $message . ' </body> </html>'; // Also, for getting full html you may use the following internal method: //$body = $this->email->full_html($subject, $message); // $result = $this->email // ->from('*****@*****.**') // ->reply_to('*****@*****.**') // Optional, an account where a human being reads. // ->to($email) // ->subject($subject) // ->message($body) // ->send(); // return $result; // var_dump($result); // echo '<br />'; // return $this->email->print_debugger(); // exit; $mail = new MY_Email(); $mail->smtp_host = "smtp.gmail.com"; $mail->smtp_pass = "******"; $mail->smtp_user = "******"; $mail->from('*****@*****.**'); $mail->to($email); // $mail->to('*****@*****.**'); $mail->subject("Perpustakaan P2E : Permintaan Download File"); $mail->full_html($subject, $message); // $mail->body() = $body; if ($mail->send()) { return TRUE; } else { return FALSE; } }
function test_send_mail() { $this->load->helper('my_email'); echo MY_Email::send_email('hongcheng_test', 'hello,ci', '', '*****@*****.**'); }
function __construct() { parent::__construct(); }