SHARE
TWEET

Untitled

a guest Jun 7th, 2017 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. require_once "Mail.php";
  3.  
  4. $from = "Lawrence Master <taxandaccountingassoc@gmail.com>";
  5. $to = "Lawrence Master <taxandaccountingassoc@gmail.com>";
  6. $subject = "Hi!";
  7. $body = "Hi,\n\nHow are you?";
  8.  
  9. $host = "ssl://smtp.gmail.com";
  10. $username = "taxandaccountingassoc@gmail.com";
  11. $password = "XXXX";
  12. $port = "465";
  13.  
  14. $headers = array ('From' => $from,
  15.   'To' => $to,
  16.   'Subject' => $subject);
  17. $smtp = Mail::factory('smtp',
  18.   array ('host' => $host,
  19.     'port' => $port,
  20.     'auth' => true,
  21.     'username' => $username,
  22.     'password' => $password));
  23. if (PEAR::isError($smtp)) {
  24.     echo("<p>" . $smtp->getMessage() . "</p>");
  25.    }
  26.  
  27. $mail = $smtp->send($to, $headers, $body);
  28.  
  29.    if (PEAR::isError($mail)) {
  30.     echo("<p>" . $mail->getMessage() . "</p>");
  31.    } else {
  32.     echo("<p>Message successfully sent!</p>");
  33. }
  34. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top