Untuk menggunakan script PHPMailer ini cara nya cukup mudah. Anda cukup menguploadnya menggunakan FTP client seperti filezilla atau file manager yang sudah tersedia pada panel hosting Anda.
Dibawah ini saya kasih contoh script eksekusi kirim emailnya. Silakan diedit scriptnya, disesuaikan dengan data email Anda:
<?php
include "PHPMailer/class.phpmailer.php";
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPSecure = 'ssl';
$mail->Host = "mail.domain.com"; //Hostname Masing-Masing Provider Email
$mail->SMTPDebug = 2;
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "xxx@domain.com"; //User Email
$mail->Password = "passwordnya"; //Password Email
$mail->SetFrom("xxx@domain.com","Nama pengirim yang muncul"); //Email Pengirim
$mail->Subject = "Testing"; //Judul email
$mail->AddAddress("xxx@domain.net","Nama penerima yang muncul"); //Email Tujuan
$mail->MsgHTML("Testing…");
if($mail->Send()) echo "Message has been sent";
else echo "Failed to sending message";
?>
Untuk menonaktifkan debugging silahkan set :
$mail->SMTPDebug = 0;
Contoh Konfigurasi gmail:
SMTP Host: smtp.gmail.com
SMTP Port: 465
Username : username@gmail.com
Password : password email
Contoh Konfigurasi mail yahoo:
SMTP Host: smtp.mail.yahoo.com
SMTP Port: 465
Username : username@yahoo.com
Password : password email
Contoh Konfigurasi outlook.com:
SMTP Host: smtp-mail.outlook.com
SMTP Port: 587
Username : username@outlook.com
Password : password email
Download Script PHPMailer
0 coment�rios:
Post a Comment