Advertisement
Guest User

Untitled

a guest
Jun 17th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <?php
  2. require("PHPMailerAutoload.php");
  3. $mail = new PHPMailer();
  4.  
  5. $mail->IsSMTP(); // set mailer to use SMTP
  6. $mail->Host = "techscape16.com"; // specify main and backup server
  7. $mail->SMTPAuth = true; // turn on SMTP authentication
  8. $mail->SMTPSecure = "tls";
  9. $mail->Username = "test@techscape16.com"; // SMTP username
  10. $mail->Password = "tester"; // SMTP password
  11.  
  12. $mail->SMTPDebug = 1;
  13.  
  14. $mail->From = "test@techscape16.com";
  15. $mail->FromName = "tester email";
  16. $mail->AddAddress("hidayat_techscape@yahoo.co.id", "Ahmad Hidayat");
  17. #$mail->AddAddress("ellen@example.com"); // name is optional
  18. #$mail->AddReplyTo("info@example.com", "Information");
  19.  
  20. #$mail->WordWrap = 50; // set word wrap to 50 characters
  21. #$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
  22. #$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
  23. #$mail->IsHTML(true); // set email format to HTML
  24.  
  25. $mail->Subject = "pengecekan kirim email dengan phpmailer";
  26. $mail->Body = "pengecekan email dengan <b>PHPMailer!</b>";
  27. $mail->AltBody = "pengecekan email dengan phpmailer";
  28.  
  29. if(!$mail->Send())
  30. {
  31. echo "Message could not be sent. <p>";
  32. echo "Mailer Error: " . $mail->ErrorInfo;
  33. exit;
  34. }
  35.  
  36. echo "Message has been sent";
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement