Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sends mail two times - codeigniter
- $config = Array(
- 'protocol' => 'smtp',
- 'smtp_host' => 'ssl://smtp.googlemail.com',
- 'smtp_port' => 465,
- 'smtp_user' => 'mertmetinbjk@gmail.com',
- 'smtp_pass' => '****',
- 'mailtype' => 'html'
- );
- public function kayitOnay() {
- $username = $this->input->post('username');
- $email = $this->input->post('email');
- $password = $this->input->post('password');
- $data = array();
- $data['username'] = $username;
- $data['email'] = $email;
- $data['password'] = $password;
- $activationCode = $this->randomString(9);
- //Mail server ayarları config/email.php dosyası altında
- $this->load->library('email');
- $this->email->set_newline("rn");
- $this->load->view('kayit/kayitOnay', $data);
- $this->kayitmodel->uyeEkle($username, $email, $password, $activationCode);
- $dataLink['link'] = "/kayit/kayitEmailOnay/$activationCode";
- $this->email->from('bildirim@pasaj.com', 'Pasaj.com');
- $this->email->to('mertmetinbjk@gmail.com');
- $this->email->subject('Hesap Aktivasyonu');
- $email = $this->load->view('kayit/kayitOnayMail', $dataLink, TRUE);
- $this->email->message($email);
- $this->email->send();
- }
- public function kayitSon() {
- $this->load->view("kayit/kayitTamamla");
- }
- public function kayitHata() {
- $this->load->view("kayit/kayitHata");
- }
- public function kayitEmailOnay() {
- $registrationCode = $this->uri->segment(3);
- if ($registrationCode == '') {
- echo "URLde onay kodu yok";
- }
- $registrationConfirmed = $this->kayitmodel->uyeOnay($registrationCode);
- if ($registrationConfirmed)
- $this->kayitSon();
- else
- $this->kayitHata();
- }
Add Comment
Please, Sign In to add comment