Advertisement
Guest User

Untitled

a guest
Apr 5th, 2017
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. require 'class.phpmailer.php';
  3.  
  4. $mail = new PHPMailer;
  5. $mail->SMTPDebug = 1;
  6.  
  7. $mail->IsSMTP(); // Set mailer to use SMTP
  8. $mail->Host = 'server129.web-hosting.com'; // Specify main and backup server
  9. $mail->Port = 465; // Set the SMTP port
  10. $mail->SMTPAuth = true; // Enable SMTP authentication
  11. $mail->Username = 'info@mydomain.com'; // SMTP username
  12. $mail->Password = 'password'; // SMTP password
  13. $mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
  14.  
  15. $mail->From = 'info@mydomain.com';
  16. $mail->FromName = 'test';
  17. $mail->AddAddress('ricky24352@hotmail.com', 'Customer'); // Add a recipient
  18.  
  19.  
  20. $mail->IsHTML(true); // Set email format to HTML
  21.  
  22. $mail->Subject = 'Here is the subject';
  23. $mail->Body = 'This is the HTML message body <strong>in bold!</strong>';
  24. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  25.  
  26. if(!$mail->Send()) {
  27. echo 'Message could not be sent.';
  28. echo 'Mailer Error: ' . $mail->ErrorInfo;
  29. exit;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement