script smtp authentication

<?php
include "classes/class.phpmailer.php";
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPSecure = ‘tls’;
$mail->Host = "localhost"; //hostname masing-masing provider email
$mail->SMTPDebug = 2;
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = "[email protected]"; //user email
$mail->Password = "XXXXX"; //password email
$mail->SetFrom("[email protected]","Nama pengirim yang muncul"); //set email pengirim
$mail->Subject = "Testing"; //subyek email
$mail->AddAddress("[email protected]","Nama penerima yang muncul"); //tujuan email
$mail->MsgHTML("Testing…");
if($mail->Send()) echo "Message has been sent";
else echo "Failed to sending message";

echo "<script>window.alert('Your Submission Has Been Received');
window.location=('index.htm')</script>";
?>

 

Sidebar