Advertisement
Guest User

Untitled

a guest
Mar 10th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <?php
  2. require 'PHPMailer/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. $mail->SMTPDebug = 3; // Enable verbose debug output
  7.  
  8. $mail->isSMTP(); // Set mailer to use SMTP
  9. $mail->Host = 'ikeashop.ge'; // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true; // Enable SMTP authentication
  11. $mail->Username = 'info@ikeashop.ge'; // SMTP username
  12. $mail->Password = 'ikeainfo3301'; // SMTP password
  13. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  14. $mail->Port = 587; // TCP port to connect to
  15. $mailer->SMTPOptions = ['ssl'=> ['allow_self_signed' => true]];
  16.  
  17. $mail->setFrom('info@ikeashop.ge', 'Mailer');
  18. $mail->addAddress('kaki.tk@gmail.com', 'Joe User'); // Add a recipient
  19. $mail->addReplyTo('info@ikeashop.ge', 'Information');
  20.  
  21. $mail->isHTML(true); // Set email format to HTML
  22.  
  23. $mail->Subject = 'Here is the subject';
  24. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  25. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  26.  
  27. if(!$mail->send()) {
  28. echo 'Message could not be sent.';
  29. echo 'Mailer Error: ' . $mail->ErrorInfo;
  30. } else {
  31. echo 'Message has been sent';
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement