Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/phpmailer/phpmailer/src/Exception.php';
require 'vendor/phpmailer/phpmailer/src/PHPMailer.php';
require 'vendor/phpmailer/phpmailer/src/SMTP.php';
// SMTP server configuration
$smtpHost = 'smtp.corporateip.nl'; // Replace with your SMTP server address
$smtpUsername = 'ID262863_corporateip'; // Your SMTP username (usually your email)
$smtpPassword = 'xWfXwTAeFsCQuCm'; // Your SMTP password
$smtpPort = 2525; // Typically 587 for TLS, or 465 for SSL
$smtpEncryption = PHPMailer::ENCRYPTION_STARTTLS; // TLS encryption (or PHPMailer::ENCRYPTION_SMTPS for SSL)
// Domain detection
$currentDomain = $_SERVER['HTTP_HOST'];
// Form submission handling
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = htmlspecialchars($_POST['name']);
$phone = htmlspecialchars($_POST['phone']);
$email = htmlspecialchars($_POST['email']);
$offer = htmlspecialchars($_POST['offer']);
$additionalInfo = htmlspecialchars($_POST['additional_info']);
// Create a new PHPMailer instance
$mail = new PHPMailer(true);
try {
// SMTP configuration
$mail->isSMTP();
$mail->Host = $smtpHost;
$mail->SMTPAuth = true;
$mail->Username = $smtpUsername;
$mail->Password = $smtpPassword;
$mail->SMTPSecure = $smtpEncryption;
$mail->Port = $smtpPort;
// Email details
$mail->setFrom($smtpUsername, 'Domain Seller'); // Sender email and name
$mail->addAddress('youremail@example.com'); // Recipient email
$mail->addReplyTo($email, $name); // Reply-to email and name
$mail->isHTML(true);
$mail->Subject = "Interest in domain: $currentDomain";
$mail->Body = "
<strong>Name:</strong> $name<br>
<strong>Phone:</strong> $phone<br>
<strong>Email:</strong> $email<br>
<strong>Offer:</strong> €$offer<br>
<strong>Additional Info:</strong> $additionalInfo
";
$mail->send();
$feedback = "Thank you! Your message has been sent.";
} catch (Exception $e) {
$feedback = "Error: {$mail->ErrorInfo}";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($currentDomain); ?> - May Be For Sale</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; margin: 20px; }
form { max-width: 500px; margin: 0 auto; }
input, textarea, button { width: 100%; padding: 10px; margin: 10px 0; font-size: 16px; }
button { background-color: #007BFF; color: white; border: none; cursor: pointer; }
button:hover { background-color: #0056b3; }
.feedback { margin-top: 20px; color: green; }
</style>
</head>
<body>
<h1><?php echo htmlspecialchars($currentDomain); ?> May Be For Sale</h1>
<p>Interested in this domain? Fill out the form below:</p>
<form method="POST" action="">
<input type="text" name="name" placeholder="Name" required>
<input type="tel" name="phone" placeholder="Phone Number" required>
<input type="email" name="email" placeholder="Email Address" required>
<input type="text" name="offer" placeholder="Offer in €" required>
<textarea name="additional_info" placeholder="Additional Information" rows="4"></textarea>
<button type="submit">Submit</button>
</form>
<?php if (!empty($feedback)) : ?>
<p class="feedback"><?php echo $feedback; ?></p>
<?php endif; ?>
</body>
</html>