Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2.  
  3. $to = "Ramona Recipient ";
  4. $subject = "Hi!";
  5. $body = "Hi,nnHow are you?";
  6.  
  7. $host = "ssl://smtp.gmail.com";
  8. $port = "465";
  9. $username = "test";
  10. $password = "test";
  11.  
  12. $headers = array ('From' => $from,
  13. 'To' => $to,
  14. 'Subject' => $subject);
  15. $smtp = Mail::factory('smtp',
  16. array ('host' => $host,
  17. 'port' => $port,
  18. 'auth' => true,
  19. 'username' => $username,
  20. 'password' => $password));
  21.  
  22. $mail = $smtp->send($to, $headers, $body);
  23.  
  24. if (PEAR::isError($mail)) {
  25. echo("
  26.  
  27. " . $mail->getMessage() . "
  28. "); } else { echo("
  29.  
  30. Message successfully sent!
  31. "); }
  32. include('index.html');
  33. ?>
  34.  
  35. <form>
  36. <div class="form-group">
  37. <input type="text" name="mail" class="form-control" placeholder="Email Address">
  38. </div>
  39. <div class="form-group">
  40. <input type="text" name="subject" class="form-control" placeholder="Subject">
  41. </div>
  42. <div class="form-group">
  43. <textarea class="form-control" name="text" rows="3" placeholder="Your Message"></textarea>
  44. <button class="btn btn-default" type="submit" >Send Message</button>
  45. </div>
  46. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement