Advertisement
Guest User

Untitled

a guest
Sep 11th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. if ( ! extension_loaded( 'openssl' ) ) {
  2. echo ' no está activada';
  3. }else{
  4. $this->load->library("PhpMailerLib");
  5. $mail = $this->phpmailerlib->load();
  6. try {
  7. /*
  8. //Server settings
  9. $mail->SMTPDebug = 4; // Enable verbose debug output
  10. $mail->isSMTP(); // Set mailer to use SMTP
  11. $mail->Host = 'smtp.ingeniumventures.com'; // Specify main and backup SMTP servers
  12. $mail->SMTPAuth = true; // Enable SMTP authentication
  13. $mail->Username = 'contacto@ingeniumventures.com'; // SMTP username
  14. $mail->Password = 'Pllbn8ch'; // SMTP password
  15. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  16. $mail->Port = 587; // TCP port to connect to
  17. */
  18. $mail->SMTPSecure = "tls";
  19. $mail->Host='smtp.ingeniumventures.com';
  20. $mail->Port='587';
  21. $mail->Username = 'contacto@ingeniumventures.com'; // SMTP account username
  22. $mail->Password = 'Pllbn8ch';
  23. $mail->SMTPKeepAlive = true;
  24. $mail->Mailer = "smtp";
  25. $mail->IsSMTP(); // telling the class to use SMTP
  26. $mail->SMTPAuth = true; // enable SMTP authentication
  27. $mail->CharSet = 'utf-8';
  28. $mail->SMTPDebug = 4;
  29.  
  30. //Recipients
  31. $mail->setFrom('contacto@ingeniumventures.com', 'Ingenium ventures');
  32. $mail->addAddress('contacto@ingeniumventures.com', 'Ingenium ventures'); // Add a recipient
  33.  
  34. //$mail->addCC('cc@example.com');
  35. //$mail->addBCC('bcc@example.com');
  36.  
  37. //Attachments
  38. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  39. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  40.  
  41. //Content
  42. $mail->isHTML(true); // Set email format to HTML
  43. $mail->Subject = 'Here is the subject';
  44. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  45. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  46.  
  47. $mail->send();
  48. echo 'Message has been sent 6';
  49. } catch (Exception $e) {
  50. echo 'Message could not be sent.';
  51. echo 'Mailer Error: ' . $mail->ErrorInfo;
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement