Advertisement
Guest User

Untitled

a guest
Sep 15th, 2016
1,783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. function Email($to, $subject, $body)
  2. {
  3.     require 'inc/PHPMailerAutoload.php';
  4.  
  5.     $mail = new PHPMailer;
  6.  
  7. //$mail->SMTPDebug = 3;                               // Enable verbose debug output
  8.  
  9. $mail->isSMTP();                                      // Set mailer to use SMTP
  10. $mail->Host = 'smtp.zoho.com';  // Specify main and backup SMTP servers
  11. $mail->SMTPAuth = true;                               // Enable SMTP authentication
  12. $mail->Username = 'site@btcmodafinil.com';                 // SMTP username
  13. $mail->Password = '6hugdKL9ThyF';                           // SMTP password
  14. $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
  15. $mail->Port = 587;                                    // TCP port to connect to
  16.  
  17. $mail->setFrom('hello@btcmodafinil.com', 'BTC Modafinil Team');
  18. $mail->addAddress($to);     // Add a recipient
  19.  
  20. $mail->isHTML(true);                                  // Set email format to HTML
  21.  
  22. $mail->Subject = $subject;
  23. $mail->Body    = $body;
  24.  
  25. if(!$mail->send()) {
  26.     return $mail->ErrorInfo;
  27. } else {
  28.     return true;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement