Advertisement
Guest User

Untitled

a guest
May 20th, 2017
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.44 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'Net/SMTP.php'; //YOU MAY HAVE PROBLEMS HERE, IT DEPENDS WHERE SMTP.php IS STORED ON YOUR PC
  4.  
  5. //CHANGE THIS SHITE
  6. $email_server = "ssl://smtp.gmail.com";
  7. $email_server_port = "465";
  8. $email_local_server = "sbarber-web.homelinux.com";
  9. $email_username = "s.jeff.barber@googlemail.com";
  10. $email_password = "PASSWORD";
  11. $email_from = "7 Sound";
  12. $email_to = "EMAIL ADDRESS TO SEND EMAIL TO";
  13. $email_subject = "Activate your account";
  14.  
  15. $email_message = "MESSAGE";
  16.  
  17.  
  18. if (! ($smtp = new Net_SMTP($email_server, $email_server_port, $email_local_server))) {
  19.         die("Unable to instantiate Net_SMTP object\n");
  20. }
  21.  
  22. #$smtp->setDebug(true);
  23.  
  24. if (PEAR::isError($e = $smtp->connect())) {
  25.         die($e->getMessage() . "\n");
  26. }
  27.  
  28. if (PEAR::isError($e = $smtp->auth($email_username, $email_password))) {
  29. }
  30.  
  31. if (PEAR::isError($smtp->mailFrom($email_from))) {
  32.         die("Unable to set sender to <" . $email_from . ">\n");
  33. }
  34.  
  35. if (PEAR::isError($res = $smtp->rcptTo($email_to))) {
  36.         die('Unable to add recipient <' . $email_to . '>: ' .
  37.                 $res->getMessage() . "\n");
  38. }
  39.  
  40. if (PEAR::isError($smtp->data(  "To: " . $email_to . "\r\n" .
  41.                 "From: " . $email_from . "\r\n" .
  42.                 "Subject: " . $email_subject . "\r\n" .
  43.                 "MIME-Version: 1.0\n" . $email_message))) {
  44.         die("Unable to send data\n");
  45. }
  46.  
  47. $smtp->disconnect();
  48.  
  49. //REDIRECT
  50. echo "<script>document.location='index.php?tab=5'</script>";
  51.  
  52. }
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement