-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
40 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
// Include PHPMailer library | ||
require 'PHPMailer/PHPMailerAutoload.php'; | ||
|
||
// Configuration | ||
$toEmail = '[email protected]'; // Ganti dengan alamat email penerima | ||
$subject = 'Pesan dari Formulir Kontak'; | ||
$fromEmail = $_POST['email']; | ||
$fromName = $_POST['name']; | ||
$message = $_POST['comment']; | ||
|
||
// Create a new PHPMailer instance | ||
$mail = new PHPMailer; | ||
|
||
|
||
// Set sender and recipient | ||
$mail->setFrom($fromEmail, $fromName); | ||
$mail->addAddress($toEmail); | ||
|
||
// Set email subject and message | ||
$mail->Subject = $subject; | ||
$mail->Body = $message; | ||
|
||
// Send the email | ||
if ($mail->send()) { | ||
// Jika email berhasil dikirim | ||
echo 'Pesan Anda telah berhasil terkirim.'; | ||
} else { | ||
// Jika ada kesalahan dalam pengiriman | ||
echo 'Pesan Anda tidak dapat terkirim. Error: ' . $mail->ErrorInfo; | ||
} | ||
?> |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.