Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("PHPMailerAutoload.php");
- $mail = new PHPMailer();
- $mail->IsSMTP(); // set mailer to use SMTP
- $mail->Host = "techscape16.com"; // specify main and backup server
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->SMTPSecure = "tls";
- $mail->Username = "test@techscape16.com"; // SMTP username
- $mail->Password = "tester"; // SMTP password
- $mail->SMTPDebug = 1;
- $mail->From = "test@techscape16.com";
- $mail->FromName = "tester email";
- $mail->AddAddress("hidayat_techscape@yahoo.co.id", "Ahmad Hidayat");
- #$mail->AddAddress("ellen@example.com"); // name is optional
- #$mail->AddReplyTo("info@example.com", "Information");
- #$mail->WordWrap = 50; // set word wrap to 50 characters
- #$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
- #$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
- #$mail->IsHTML(true); // set email format to HTML
- $mail->Subject = "pengecekan kirim email dengan phpmailer";
- $mail->Body = "pengecekan email dengan <b>PHPMailer!</b>";
- $mail->AltBody = "pengecekan email dengan phpmailer";
- if(!$mail->Send())
- {
- echo "Message could not be sent. <p>";
- echo "Mailer Error: " . $mail->ErrorInfo;
- exit;
- }
- echo "Message has been sent";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement