Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function reply()
- {
- $data = $this->input->post();
- $data['answered']=date('Y-m-d H:i:s');
- $id = $this->input->post('id');
- $subject = $this->input->post('subject');
- $message = $this->input->post('answer');
- $emailto = $this->input->post('email');
- // 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: 20px;
- }
- </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('hello@1man1tourist.com')
- ->to($emailto)
- ->subject($subject)
- ->message($body)
- ->send();
- if($result) {
- $this->messages_model->updateData($id, $data);
- //if process insert success
- $this->session->set_flashdata('message_success', "Successfully insert data and send to email");
- } else {
- //process insert failed
- $this->session->set_flashdata('message_danger', "Failed insert data");
- }
- redirect('/messagesdata/');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement