Advertisement
Guest User

Untitled

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