Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. require_once "Mail.php";
  3. $from = "Sandra Sender <form@bridge2server.com>";
  4. $to = "Ramona Recipient <santanu@yesdaddy.in>";
  5. $subject = "Hi!";
  6. $body = "Hi,\n\nHow are you?";
  7. $host = "mail.bridge2server.com";
  8. $username = "form@bridge2server.com";
  9. $password = "poiu@1234@";
  10. $headers = array ('From' => $from,
  11.   'To' => $to,
  12.   'Subject' => $subject);
  13. $smtp = Mail::factory('smtp',
  14.   array ('host' => $host,
  15.     'auth' => true,
  16.     'username' => $username,
  17.     'password' => $password));
  18. $mail = $smtp->send($to, $headers, $body);
  19. if (PEAR::isError($mail)) {
  20.   echo("
  21. " . $mail->getMessage() . "
  22.  
  23. ");
  24.  } else {
  25.   echo("
  26. Message successfully sent!
  27.  
  28. ");
  29.  }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement