Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2. require 'phpmail/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6.  
  7.  
  8. $mail->isSMTP();
  9. $mail->Host = 'mail.privateemail.com';
  10. $mail->SMTPAuth = true;
  11. $mail->Username = 'admin@yoursite.com';
  12. $mail->Password = 'YourPassword';
  13. $mail->SMTPSecure = 'ssl';
  14. $mail->Port = 465;
  15.  
  16. $mail->setFrom('admin@yoursite.com', 'YourSite Admin');
  17. $mail->addAddress('rmcdermott927@gmail.com', 'rmcdermott927@gmail.com');
  18.  
  19. $mail->addReplyTo('admin@yoursite.com', 'admin@yoursite.com');
  20.  
  21.  
  22.  
  23. $mail->isHTML(true);
  24. $mail->Subject = 'Here is the subject';
  25. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  26. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  27.  
  28. if(!$mail->send()) {
  29. echo 'Message could not be sent.';
  30. echo 'Mailer Error: ' . $mail->ErrorInfo;
  31. } else {
  32. echo 'Message has been sent';
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement