Guest User

Untitled

a guest
Jul 21st, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. function form_gonder(){
  2.     $data['ad'] = $this->input->post('ad',TRUE);
  3.     $data['soyad'] = $this->input->post('soyad',TRUE);
  4.     $data['ileti'] = $this->input->post('ileti',TRUE);
  5.     $data['telefon'] = $this->input->post('telefon',TRUE);
  6.     $data['email'] = $this->input->post('email',TRUE);
  7.     $data['konu'] = $this->input->post('konu',TRUE);
  8.     $data['code'] = $this->ups($this->input->post('code',TRUE));
  9.     $data['ip'] = $this->input->ip_address();
  10.     $g_code = $this->session->userdata('code');
  11.     if($data['code'] == $g_code){
  12.         if($data['ad'] and $data['soyad'] and $data['ileti']){
  13.             // Mail Gonder
  14.             $this->load->library('email');
  15.             // Mail Config
  16.             $config['mailtype'] = 'html';
  17.             $config['protocol'] = 'smtp';
  18.             $config['charset'] = 'utf-8';
  19.             $config['smtp_host'] = 'mail.starabone.com';
  20.             $config['smtp_port'] = '587';
  21.             $config['smtp_user'] = 'iletisim@starabone.com';
  22.             $config['smtp_pass'] = 'Ab1234';
  23.             $this->email->initialize($config);
  24.             // Mail Bilgiler
  25.             $this->email->reply_to($data['email'], $data['ad']);
  26.             $this->email->from('iletisim@starabone.com', 'Online Teklif Formu');
  27.             $this->email->to('iletisim@starabone.com');
  28.             $this->email->subject('STAR Abone İletişim Formu');
  29.             $this->email->message('<p><b>Ad : </b><br/>' . $data['ad'] . " ".$data['soyad']. '</p><p><b>Telefon : </b><br/>' . $data['telefon'] . '</p><p><b>Ip :</b><br/>' . $data['ip'] . '</p><p><b>E-Mail:</b><br/>' . $data['email'] . '</p><p><b>Konu :</b><br/>' . $data['konu'] . '</p><p><b>İleti:</b><br/>' . $data['ileti'] . '</p>');
  30.             try {
  31.                 if ($this->email->send()) {
  32.                     echo 'Teşekkürler. Mailiniz Bize Ulaştı.';
  33.                 } else {
  34.                     echo 'Mail Göderilirken Hata Oluştu: '. $this->email->print_debugger();
  35.                 }
  36.             } catch (Exception $e) {
  37.                 echo 'Hata: '.$e->getMessage();
  38.             }
  39.  
  40.             print_r($data);exit();
  41.             echo '<hr>' .$this->email->print_debugger();
  42.         }else{
  43.             echo 'Tüm Alanları Doldurmalısınız.';
  44.         }
  45.     }else{
  46.         echo 'Güvenlik Kodu Hatalı.';
  47.     }
  48. }
Add Comment
Please, Sign In to add comment