Advertisement
Guest User

Untitled

a guest
Sep 11th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. $this->load->library("PhpMailerLib");
  2. $mail = $this->phpmailerlib->load();
  3. try {
  4.  
  5. $emails = 'comercial@ingeniumventures.com';
  6. $name = $this->input->post('name');
  7. $email = $this->input->post('email');
  8. $phone = $this->input->post('phone');
  9. $msg = $this->input->post('text');
  10. $mensaje = 'Se ha recibido un nuevo mensaje de:
  11. Nombre: '.$name.'
  12. Email: '.$email.'
  13. Tlfn: '.$phone.'
  14. Mensaje: '.$msg;
  15. //Server settings
  16. $mail->SMTPDebug = 2; // Enable verbose debug output
  17. $mail->isSMTP(); // Set mailer to use SMTP
  18. $mail->Host = 'smtp.ingeniumventures.com'; // Specify main and backup SMTP servers
  19. $mail->SMTPAuth = true; // Enable SMTP authentication
  20. $mail->Username = 'contacto@ingeniumventures.com'; // SMTP username
  21. $mail->Password = 'Pllbn8ch'; // SMTP password
  22. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  23. $mail->Port = 587; // TCP port to connect to
  24. //Recipients
  25. $mail->setFrom('contacto@ingeniumventures.com', 'Ingenium ventures');
  26. $mail->addAddress('contacto@ingeniumventures.com', 'Ingenium ventures'); // Add a recipient
  27.  
  28. //$mail->addCC('cc@example.com');
  29. //$mail->addBCC('bcc@example.com');
  30.  
  31. //Attachments
  32. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  33. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  34.  
  35. //Content
  36. $mail->isHTML(true); // Set email format to HTML
  37. $mail->Subject = 'Contacto desde la web';
  38. $mail->Body = $mensaje;
  39.  
  40. $mail->send();
  41. echo 'Message has been sent';
  42. } catch (Exception $e) {
  43. echo 'Message could not be sent.';
  44. echo 'Mailer Error: ' . $mail->ErrorInfo;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement