Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sending_mail(){
- $mail_config = Array (
- 'mailtype' =>'html',
- 'protocol' => 'smtp',
- 'smtp_host' => 'ssl://smtp.gmail.com',
- 'smtp_port' => 465,
- 'smtp_user' => 'myemail@gmail.com',
- 'smtp_pass' => 'mypassword',
- 'charset' => 'iso-8859-1'
- );
- $this->load->library('email',$mail_config);
- $this->email->set_newline("rn");
- $this->email->from('myemail@gmail.com', 'InnoLogiq LLP');
- $this->email->to('receipientemail@gmail.com');
- $message = 'mymessage';
- $this->email->subject("mysubject");
- $this->email->message($message);
- if($this->email->send()){
- $data['flag']="success" ;
- $data['msg']="Email sent";
- $this->load->view('templates/header1');
- $this->load->view('company/contact_us',$data);
- $this->load->view('templates/footer');
- }
- else{
- $data['msg']="Here I want mesage but its showing error, due to net connection";
- $data['flag']='error';
- print_r("Sorry! mail not send");
- $this->load->view('company/contact_us',$data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement