Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $config = Array(
- 'protocol' => 'smtp',
- 'smtp_host' => $smtp['mail_server'],
- 'smtp_port' => $smtp['port'],
- 'smtp_user' => $smtp['mail_username'],
- 'smtp_pass' => $smtp['mail_password'],
- 'smtp_crypto' => ($smtp['tls'] == 0 ? NULL : 'tls'),
- 'mailtype' => 'text',
- 'charset' => 'iso-8859-1'
- );
- $this->load->library('email');
- $this->email->clear();
- $this->email->initialize($config);
- $this->email->set_newline("\r\n");
- // Set to, from, message, etc.
- $this->email->from($smtp['fromemail'], $smtp['fromname']);
- $this->email->to( $to );
- if($page != 'useradmin')
- {
- $this->email->cc( array($this->session->userdata('LoginEmailAddress'), $smtp['fromemail']));
- }
- if( $cc )
- {
- $this->email->cc( $cc );
- }
- if( $bcc )
- {
- $this->email->bcc( $bcc );
- }
- if( $attach )
- {
- if( is_array($attach) )
- {
- foreach( $attach as $location )
- {
- $this->email->attach( $location );
- }
- }
- else
- {
- $this->email->attach( $attach );
- }
- }
- $this->email->subject( $subject );
- $this->email->message( $body );
- return $this->email->send();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement