Advertisement
Guest User

pagina

a guest
Feb 27th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1. <?php
  2. if($this->agent->is_browser()){
  3.     $agent = $this->agent->browser().' '.$this->agent->version();
  4. }elseif($this->agent->is_robot()){
  5.     $agent = $this->agent->robot();
  6. }elseif ($this->agent->is_mobile()){
  7.     $agent = $this->agent->mobile();
  8. }else{
  9.     $agent = 'Não foi identificado o User Agent';
  10. }
  11.  
  12. $mensagem = '
  13. <!DOCTYPE html>
  14. <html lang="pt-BR">
  15. <head>
  16.     <meta charset="UTF-8">
  17.     <title>Contato pelo Site via E-mail '.date("d/m/Y").'-'.date("H:i").'</title>
  18. </head>
  19. <body>
  20.     <h1>Contato pelo Site via E-mail '.date("d/m/Y").'-'.date("H:i").' para Envio de Currículo</h1>
  21.     <p><b>Nome:</b> '.$this->input->post('nome').'</p>
  22.     <p><b>Telefone:</b> '.$this->input->post('telefone').'</p>
  23.     <p><b>E-mail:</b> '.$this->input->post('email').'</p>
  24.     <p>Caso o currículo não esteja em anexo, faça o download <a href="'.site_url('assets/curriculo/'.$nome_curriculo).'" title="Clique e veja o arquivo">'.site_url('assets/curriculo/'.$nome_curriculo).'</a>.</p>
  25.     <p><b>Acessado via:</b> '.$agent.' | <b>Plataforma:</b> '.$this->agent->platform().' | <b>IP:</b> '.$this->input->ip_address().'</p>
  26. </body>
  27. </html>';
  28.  
  29. $this->email->from('[email protected]', 'Contato pelo Site');
  30. $this->email->reply_to($this->input->post('email'), $this->input->post('nome'));
  31. $this->email->to('[email protected]');
  32. $this->email->cc('[email protected]');
  33. //$this->email->bcc('[email protected]');
  34. $this->email->subject('Envio de Currículo - '.date("d/m/Y").'-'.date("H:i"));
  35. $this->email->message($mensagem);
  36. $this->email->attach(site_url('assets/curriculo/'.$nome_curriculo), 'attachment', $this->input->post('nome').'.pdf', 'application/pdf');
  37.  
  38. if($this->email->send()){
  39.     redirect('Contato/Trabalhe_Conosco/Sucesso');
  40. }else{
  41.     // echo $this->email->print_debugger();
  42.     // echo $mensagem;
  43.     redirect('Contato/Trabalhe_Conosco/ErroEmail');
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement