Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'phpmailer/PHPMailerAutoload.php';
- $email = 'mingkengdota@gmail.com'; //EMAIL YANG DIPAKE KIRIM EMAIL
- $password = 'mingkeng007'; //PASSWORD EMAIL
- $to_id = $_POST["email"]; //EMAIL TUJUAN
- $message = $_POST["message"]; //ISI PESAN
- $subject = '[Website Form] Eternal Organizer'; //SUBJECT EMAIL
- /* DI DISABLE
- $name = $_POST["name"];
- $email = $_POST["email"];
- $message = $_POST["message"];
- $Body = $_POST["Body"];
- */
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = $email;
- $mail->Password = $password;
- $mail->setFrom('from@example.com', 'First Last');
- $mail->addReplyTo('replyto@example.com', 'First Last');
- $mail->addAddress($to_id);
- $mail->Subject = $subject;
- $mail->msgHTML($message);
- if (!$mail->send()) {
- $error = "Mailer Error: " . $mail->ErrorInfo;
- echo $error;
- }
- else {
- echo "sukses";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement